[Techtalk] rsync backup script

Akkana Peck akkana at shallowsky.com
Mon Jun 21 21:15:57 EST 2004


Carla Schroder writes:
> 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.

Related: does anyone use rsync for bidirectional copies?

I use rsync to back up my web site to several redundant machines.
I consider the live version on the web server to be the "master
copy", so periodically from my desktop or laptop I do:
 rsync -avv webserver:/path/to/website/ /path/to/backup/website/
(-e ssh is implied by the environment variable RSYNC_RSH=ssh).

But I also like to be able to edit pages with mozilla locally,
or move local images into position in my local copy, then syncronize
them back up to the server:
 rsync -avv /path/to/backup/website/ webserver:/path/to/website/

The problem is that somehow this confuses rsync's notion of dates,
so frequently I'll change a couple files on the server then rsync
down to the desktop, and it seems to be copying everything all over
again.  At least, the feedback given with -vv doesn't give me the
usual "(up to date)" and it pauses for a while on big files.

Everybody else I ask who uses rsync regularly seems to use it
unidirectionally: only to back up machine1 to machine2, never to
go back from machine2 to machine1.  Is rsync the wrong tool for
syncing directories in both directions?

	...Akkana


More information about the Techtalk mailing list