Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Using date/time variables in cronjobs?
Date: Mon, 06 May 2013 09:48:39
Message-Id: 20130506104814.51caac64@digimed.co.uk
In Reply to: Re: [gentoo-user] Using date/time variables in cronjobs? by Tanstaafl
1 On Sun, 05 May 2013 19:21:18 -0400, Tanstaafl wrote:
2
3 > For example, I want to keep 17 hourlies, and 30 nightlies, so I have
4 > two cron jobs set up, the hourly, and the nightly. Each backs up to a
5 > separate dir.
6
7 So each time your backup fails, you reduce the number of available
8 backups by one. If you want to use this approach, delete one backup AFTER
9 you have created AND tested a new backup.
10
11 > I'm thinking the easiest way would be to find and delete the oldest
12 > file in the backup target directory before executing the backup command.
13 >
14 > For the hourlies dir, I'd just find the files that are older than one
15 > day - so maybe:
16
17 What about
18
19 rm -f $(ls -1t backuppattern* | tail -n +numbertokeep)
20
21
22 --
23 Neil Bothwick
24
25 The Computer is the logical advancement of humankind:
26 intelligence without morality.

Attachments

File name MIME type
signature.asc application/pgp-signature