help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using make for backups


From: Nicholas Mc Guire
Subject: Re: using make for backups
Date: Mon, 24 Aug 2009 16:16:46 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, 24 Aug 2009, Payal wrote:

> On Mon, Aug 24, 2009 at 01:59:46PM +0200, Nicholas Mc Guire wrote:
> > On Mon, 24 Aug 2009, Payal wrote:
> > 
> > > Hi all
> > > Daily I take backup of a folder like this.
> > > tar -czf d-`date +%d%m%y`.tar.gz designs/
> > > The size comes ~ 2Gb of tar ball.
> > 
> > --update (-u) to tar would take care of that - it will only update changed
> > files - man tar for details.
> 
> Hmmm no. "-u" keeps "both" the copies. See below.
> $ touch test
> $ tar -cf d.tar test 
> $ echo hi > test 
> $ tar -uf d.tar test 
> $ tar -tvf d.tar 
> -rw-r--r-- payal/payal 0 2009-08-24 18:01 test
> -rw-r--r-- payal/payal 3 2009-08-24 18:02 test
>

thats what it supposed to do - it created a duplicate tree but the second tree
only contains the changed file - when you unpack it you get the last version
(but you could actually restore the old one as well).

if you only want the changed versions alon then something like

tar -N $(date -d "now 1 days ago" +%Y-%b-%d) -czf arch.tar.gz directory

or by referencing a trigger file

tar --newer="`date -r directory/timestamp`" -czf arch_new.tar.gz directory

should do

HTH
hofrat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]