Hello, 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. What's the easiest way to do this ? Thanks you Andreas
On Fri, 2004-01-09 11:38:20 +0100, Andreas Moroder <amoroder@sb-brixen.it> wrote in message <btm0g5$l61$1@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@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 : lists.samba.org/archive/rsync/attachments/20040109/666164ac/attachment.bin
On Fri, Jan 09, 2004 at 11:38:20AM +0100, Andreas Moroder wrote:> Hello, > > 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. > > What's the easiest way to do this ?What constitutes easiest will depend on a number of factors. Until you have thought of at least three ways of doing it you don't know the problem well enough. None of the first four that come to mind are difficult. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt