[request] Backup manager

maxi

Verified User
Joined
Jan 7, 2006
Messages
7
Cfn you add an ability to add job to delete automaticaly old backups(by some parameters). It will be very useful, because sometimes there are many backups on second hard drive(daily backups) and it is full.... )
 
maxi said:
Cfn you add an ability to add job to delete automaticaly old backups(by some parameters). It will be very useful, because sometimes there are many backups on second hard drive(daily backups) and it is full.... )



agreed
 
It would be a great feature. Now i have to delete everything manualy and that sucks :D

Hope it will be in it very soon
 
I fourth that motion ;).

At this moment I upload all stuff to backup server, but the problem is, once every x days the backup fails due to the user being over quota (i prefer over quota above disk with 0 bytes free).

But the situation is far from good with this solution...
 
I agree, the ability to keep a limited number of backups would be great.

Also, a symlink pointing to the latest backup would be a nice touch.
 
I support this as well. I've been wondering if one could write a cron to delete backups based on date... but that is beyond me.

I have a pair of RAID 1 36GB disks that handle backups but even they get full after a few months.

I'd like to be able to specify how many backups I want to keep. Since I do weekly system backups I'd like to keep one or two weeks on file then add the newest (third backup) to the directory... or whatever parameters I specify. I have enough space with the current sites that I could keep 10 or so...but that's kind of overkill for my sites. I just don't want to delete everything prior to creating a new backup.
 
Last edited:
something like this then:

Code:
#!/bin/bash
rm -f /backup/DirectAdmin/latest
ln -s /backup/DirectAdmin/`date +%m-%d-%y` /backup/DirectAdmin/latest

echo "rm -rf  /backup/DirectAdmin/`date -d "3 weeks ago" +%m-%d-%y`" >> deleted.txt
This will regularly recreate a 'latest' symlink to the last backup, and will delete the backup that was run 3 weeks ago.

For daily backups, change 'weeks' to 'days'. If you want to keep the last backup of every month, add an if in there to check is the 3rd of the month and don't delete the old backup if it is. (I don't think this makes sense for weekly backups, but you could use the %W parameter to get the week number of year)
eg.
Code:
if [ `date +%d` -ne 3 ]
then
        rm -rf  /backup/DirectAdmin/`date -d "3 days ago" +%m-%d-%y`
fi
I also made it echo the delete command to a file instead of running it so you can be confident that it works before removing the echo part of the delete line.
 
Back
Top