[Gllug] Verifying rsync copy

Alain Williams addw at phcomp.co.uk
Wed May 13 11:07:05 UTC 2009


On Wed, May 13, 2009 at 09:59:14AM +0100, Jon Dye wrote:
> 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.
> 
> One thought I had was to run the rsync without --verbose first to make
> the copy and then to run it again with --verbose to verify the result.
>  Unfortunately this still passes me several lines that I don't really
> want.  Does anyone know if there is some way to get rsync to just
> return whether or not files were actually sent?  Is there some clever
> parsing of output I can do?  Anyone have any other ideas (using any
> other tools)?

I have a script that I use a lot for this sort of thing. It carefully
checks return codes, etc. One other thing that it will do is to
compare a 'du' of today with yesterday and warn if the disk used is
more that X% different.

See:

	http://www.phcomp.co.uk/Packages/RsyncBackup.html

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list