info-cvs
[Top][All Lists]
Advanced

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

Re: backing up changes only?


From: James Youngman
Subject: Re: backing up changes only?
Date: 02 Dec 2000 15:27:37 +0000
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3

"DR" <address@hidden> writes:

> Hi. I'm new to CVS but seem to have it working great on my home machine. I
> have taken to backing up my entire CVS repository regularly, just by tarring
> it up and sticking it onto a ZIP disk. Is there a way instead (to save some
> disk space) to do the same, but only on the files/diffs that were
> changed/committed during the most recent, say, N days?

Why not just use a standard incremental backup scheme:-

   #! /bin/sh
   CVSROOT=/blurfl/cvsroot
   cd "$CVSROOT"
   STAMPFILE="CVSROOT/backup-timestamp"
   TAPE=/dev/st0
   tar -c -f $TAPE . `find . -type f -newer "$STAMPFILE" -print`

Note that this script will fail if any of the files or directories in
the repository contains a space, and will also fail if the list of
files to be backed up exceeds your exec limit.  To work around both
these issues, you could use GNU find and GNU tar like this :-

   #! /bin/sh
   set -e
   TAPE=/dev/rmt/0n
   CVSROOT=/blurfl/cvsroot
   STAMPFILE="CVSROOT/backup-timestamp"

   cd "$CVSROOT"
   
   touch $STAMPFILE.new
   mv $STAMPFILE $STAMPFILE.old

   find . -type f -a \( \
        -newer "$STAMPFILE".old -a \! -newer "$STAMPFILE".new \
        \) -print0 >> $LISTFILE
   tar --create --null --files-from=$LISTFILE --file=$TAPE
   rm -f "$STAMPFILE".old 
   mv "$STAMPFILE".new "$STAMPFILE"

-- 
James Youngman
Manchester, UK.  +44 161 226 7339
PGP (GPG) key ID for <address@hidden> is 64A95EE5 (F1B83152).



reply via email to

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