[ubuntu-uk] Simple backup script

Chris Rowson christopherrowson at gmail.com
Thu Jun 2 16:28:57 UTC 2011

I've been tinkering with backups and backup rotation today and I have
come across many wierd and wonderful backup scripts of varying

Is there anything wrong with using something simple like this? (except
of course for the lack of validation).

Basically, let's delete anything over 7 days old and then make a new backup.


find /home/username/backup/*.tar.gz -mtime +7 -exec rm -f {} \;
/bin/tar -cpzf /home/username/backup/`date
+%a"-"%d"-"%b"-"%y"-"`backupfile.tar.gz /var/www

More information about the ubuntu-uk mailing list