PDA

View Full Version : backup to folders with date as foldername



sander815
03-15-2004, 11:11 AM
it would be nice to add a feature to the backup script to create backups to a folder with the date of when its created
Now the backup gets overwritten by the new one

Since i backup everynight now, i would want to keep backups for say a week or so.
So, a checkbox to backup to todays date folder(or date when cronjob runs) or just overwrite last backup, like the backup DA howto : http://www.directadmin.com/forum/showthread.php?s=&threadid=1489. It creates dirs with todays date, and puts backups inthere
And the abbility, if possible, to delete backups after a certain age(maybe thats too difficult for now)
One can always delete dirs by hand

congkai
01-02-2009, 08:14 PM
i think this should be bring up again as there is still no want to upload a backup to a FTP with the folder name as the date.

floyd
01-03-2009, 04:40 AM
Write a script to rename the current backup file to include the date and run it from cron just before the next backup runs.

nobaloney
01-03-2009, 06:58 AM
Or as we do, rename the directory used for backups. Since we keep a finite number of backups we use directories named similar to this:

backup
backup.1
backup.2
backup.3
backup.4

and so forth, similar to the way log-rotate works. Then we use a script every backup period similar to this:


rm -Rf backup.4
mv backup.3 backup.4
mv backup.2 backup.3
mv backup.1 backup.2
mv backup backup.1
mkdir backup
Jeff

congkai
02-04-2009, 03:21 PM
but how can we actually rename it to a folder name before it is uploaded into the ftp source?

my backup is done over the ftp...