[ubuntu-uk] Simple backup script

Simon Greenwood sfgreenwood at gmail.com
Thu Jun 2 16:43:41 UTC 2011


On 2 June 2011 17:28, Chris Rowson <christopherrowson at gmail.com> wrote:

> I've been tinkering with backups and backup rotation today and I have
> come across many wierd and wonderful backup scripts of varying
> complexity.
>
> 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.
>
> Chris
>
> #!/bin/bash
> 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
>
>
Nope, that's fine for something simple. Half the world probably backs up
like that ;)

s/

-- 
Twitter: @sfgreenwood
"Is this your sanderling?"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20110602/10854ae2/attachment.html>


More information about the ubuntu-uk mailing list