[Gllug] Verifying rsync copy

John Hearns hearnsj at googlemail.com
Wed May 13 09:13:29 UTC 2009


2009/5/13 Jon Dye <jon at pecorous.co.uk>:
> Hi all,
>
> I use rsync to copy a directory of files to a remote location from a
> cron job once a day.  Currently I give it the --verbose option so in
> my email from cron I can see that it's actually worked (normally it's
> silent).  I'd rather just have my cron email tell me if it transfered
> anything and/or that the remote and local directories have the same
> contents.

You could look at the exit code from rsync, would that help?

http://www.mail-archive.com/rsync@lists.samba.org/msg01441.html


I guess though that you are not asking this question - you want to
know if both directory trees have the same contents.
You could write a script to md5sun each file and compare it with the
md5sum on the original server - but that's what rsync does.
How about running rsync for a second time, with the "-n" flag and
checking the output status?
Seems a bit futile really to run it again though - just check the exit
code from the original rsync.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list