[ubuntu-uk] Simple backup script
bodsda at googlemail.com
bodsda at googlemail.com
Thu Jun 2 16:49:58 UTC 2011
I would say it depends on what you mean by 'wrong'
I handle the backups for a local government, so yes, that is wrong, very wrong.
But it depends what you need it for. If you are happy with the retention that that gives you, then that's fine.
The only suggestion I would make is that you should create the backup first, and only if the backup is created successfully should you delete the old one
Hth,
Bodsda
Sent from my BlackBerry® wireless device
-----Original Message-----
From: Chris Rowson <christopherrowson at gmail.com>
Sender: ubuntu-uk-bounces at lists.ubuntu.com
Date: Thu, 2 Jun 2011 17:28:57
To: British Ubuntu Talk<ubuntu-uk at lists.ubuntu.com>
Reply-To: UK Ubuntu Talk <ubuntu-uk at lists.ubuntu.com>
Subject: [ubuntu-uk] Simple backup script
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
--
ubuntu-uk at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
More information about the ubuntu-uk
mailing list