Re: [Nolug] enumerating tar backups

From: Tim Kelley <entropy_at_r00tserverz.net>
Date: Mon, 15 Dec 2003 03:48:33 -0600
Message-Id: <200312150348.33720.entropy@r00tserverz.net>

On Sunday 14 December 2003 1:22 pm, Petri Laihonen wrote:
> Hi all!
>
> Does anybody on the list happen to know command syntax for taking
> enumerated backups using tar, so that I would only have 3 days worth
> of backups available all the time.?
>
> I have not found a tar manual explaining the method of doing this.
> The option --backup=METHOD suggest along these lines, but I have not
> found any list of allowed methods or other parameters for creating
> this.
>
> Currently I have tar automatically create the date into the filename;
> however this would consume the available HD space within a week.
> (Including mirror for backups.)
>
> What I'm trying to do is to create 3 rotating backups,
> Day 1: Backup_01.tgz (eventually Days 4, 7, 10, etc....)
> Day 2: Backup_02.tgz (eventually Days 5, 8, 11, etc....)
> Day 3: Backup_03.tgz (eventually Days 6, 9, 12, etc....)
>

Well I just do tar czf backup-`date -I`.tar.gz /foo

To get rid of the old ones you can just do something like:

find /backupdir -type f -daystart -ctime +4 | xargs rm -f

-- 
Tim Kelley (entropy AT r00tserverz.net)
New Orleans, LA
       __     __    _                _____                 
  ____/ /__  / /_  (_)___ _____    _/_/ (_)___  __  ___  __
 / __  / _ \/ __ \/ / __ `/ __ \ _/_// / / __ \/ / / / |/_/
/ /_/ /  __/ /_/ / / /_/ / / / //_/ / / / / / / /_/ />  <  
\__,_/\___/_.___/_/\__,_/_/ /_/_/  /_/_/_/ /_/\__,_/_/|_|  
http://www.debian.org                                                           
___________________
Nolug mailing list
nolug@nolug.org
Received on 12/15/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST