start a batch after rsync

Jan-Benedict Glaw jbglaw at lug-owl.de
Fri Jan 9 10:59:36 GMT 2004


On Fri, 2004-01-09 11:38:20 +0100, Andreas Moroder <amoroder at sb-brixen.it>
wrote in message <btm0g5$l61$1 at sea.gmane.org>:
> I would like to replicate one file from one machine to a second one with 
>  rsync. After the file is copied ( rsync in read mode ), if the file 
> has changed i must start a small batch, if it has not change I must do 
> nothing.

Ask for very verbose output. Then, you'll either get the filename, or
you'll get "filename is uptodate". So, if you can't find " is uptodate"
in rsync's output, start your script:

$ rsync --many-options-here 2>&1 | grep ' is uptodate$' > /dev/null 2>&1 || ./your_script.sh

Of yourse, fi
MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/rsync/attachments/20040109/666164ac/attachment.bin


More information about the rsync mailing list