On Sun, 05 May 2013 19:21:18 -0400, Tanstaafl wrote:

> For example, I want to keep 17 hourlies, and 30 nightlies, so I have
> two cron jobs set up, the hourly, and the nightly. Each backs up to a 
> separate dir.

So each time your backup fails, you reduce the number of available
backups by one. If you want to use this approach, delete one backup AFTER
you have created AND tested a new backup.

> I'm thinking the easiest way would be to find and delete the oldest
> file in the backup target directory before executing the backup command.
> 
> For the hourlies dir, I'd just find the files that are older than one 
> day - so maybe:

What about

rm -f $(ls -1t backuppattern* | tail -n +numbertokeep)


-- 
Neil Bothwick

The Computer is the logical advancement of humankind:
intelligence without morality.

Attachment: signature.asc
Description: PGP signature

Reply via email to