[Techtalk] rsync backup script

Dan Shearer dan at shearer.org
Tue Jun 22 11:15:48 EST 2004


On Mon, Jun 21, 2004 at 05:00:24PM -0700, Kai MacTane wrote:
> At 6/21/04 04:41 PM , Carla Schroder wrote:
> >Does anyone have a really really cool rsync script they'd like to share? 
> >All I know is script 'rsync -a  -e ssh sourc dest' and slap it into cron.
> >
> >Something that does some error-checking and logging would be luverly.
> >It's for publication, so you'll get fame and glory. I've tested a
> >number of scripts I found on Google, and haven't found anything that
> >doesn't need a lot of babysitting, which rather defeats the purpose.
> >For Linux only, don't worry about exotic Unixes.

There is a very nice application of rsync that turns it into a
snapshotting facility using the basic Unix filesystem feature of links,
as in "cp -al" which creates a new link rather than copying a file.

An excellent tutorial is at
http://www.mikerubel.org/computers/rsync_snapshots/ which walks you
through creating a script so that even if what you want isn't there you
have a chance of creating it anyway.

> Does it have to be rsync, or can it use scp? 

If you are transferring things more than once which are uncompressed,
then you should prefer rsync over scp. Even if time or network use don't
matter rsync can give you more information about what is going on. Did
it create this file or just overwrite it? What about detailed errors?
rsync helps you answer these questions.

-- 
Dan Shearer
dan at shearer.org


More information about the Techtalk mailing list