Results 1 to 11 of 11
Thread: How to create special backup
-
06-02-2005, 06:21 AM #1WHT Addict
- Join Date
- Dec 2003
- Posts
- 106
How to create special backup
Hello
I have an big account which used for upload images
so I don't need cpanel to create daily backup for it
I remove it from list backup in WHM
But I need to do the folowing
every 10 Days
copy the folder from /home/user/public_html
to /backup
only copy the folder
I did it but after 10 days I get an error that the folder exist in
/backup
so how I can give deferent name automatically every time for this backup folder ???
like
backup1
and after 10 days
backup2
without remove backup1
Please help
Thanks a lot
-
06-02-2005, 10:48 AM #2WHT Addict
- Join Date
- Dec 2003
- Posts
- 106
ANY hELP ???
-
06-02-2005, 01:20 PM #3Disabled
- Join Date
- Oct 2004
- Posts
- 250
write a custom script for the task!
-
06-05-2005, 07:43 AM #4WHT Addict
- Join Date
- Apr 2004
- Posts
- 149
I know that I must write custom script
But How I can create automaticaly new name for this backup file
to prevent create new file over old files ???
-
06-05-2005, 07:47 AM #5Web Hosting Evangelist
- Join Date
- Aug 2004
- Location
- Sydney, Australia
- Posts
- 465
Write a shell script that will "tar -czf filename /home/user/public_html" where you've set a filename string and include the current date in the filename string - easiest way probably.
-
06-05-2005, 08:09 AM #6WHT Addict
- Join Date
- Apr 2004
- Posts
- 149
Yes I do that
But `date` parameter have a space in it like
Sun Jun 5 15:07:50 AST 2005
How I can let this appear as
SunJun515:07:50AST2005
without space ??
or like give me only
Jun5
without the others words or spaces
Can you help
-
06-05-2005, 08:16 AM #7Web Hosting Evangelist
- Join Date
- Aug 2004
- Location
- Sydney, Australia
- Posts
- 465
Use date formatting options. For dd:mm:yyyy use:
Code:date +"%d%m%Y"
-
06-05-2005, 08:32 AM #8WHT Addict
- Join Date
- Apr 2004
- Posts
- 149
Thanks a lot it is help
but
date +"%d%m%Y"
05062005
so How I can put out month as June not 6
like to be 05June2005 rather than 05062005
and Thanks a lot
-
06-05-2005, 08:36 AM #9Web Hosting Evangelist
- Join Date
- Aug 2004
- Location
- Sydney, Australia
- Posts
- 465
Code:date +"%d%b%Y"
-
06-21-2005, 08:14 AM #10WHT Addict
- Join Date
- Dec 2003
- Posts
- 106
Thanks for all
But How I can create a folder with date
like
what I must put
mkdir now date ???
I try mkdir 'date +"%d%b%Y"'
But it is not working
can anyone help me please ??
-
06-21-2005, 12:46 PM #11Aspiring Evangelist
- Join Date
- Aug 2004
- Posts
- 417
you shouldn't use a single quote --> '
but the following --> `
so:
Code:mkdir `date +"%d%b%Y"`