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 <[email protected]>
Sender: [email protected]
Date: Thu, 2 Jun 2011 17:28:57 
To: British Ubuntu Talk<[email protected]>
Reply-To: UK Ubuntu Talk <[email protected]>
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

-- 
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
-- 
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/

Reply via email to