<div dir="ltr">Hi All,<br><br>I am in the middle of writing a script (in bash) to sync CVS vaults between two hosts. Ignoring it's a CVS vault, I am talking about running a cron job syncing files between two hosts - something that some/most of you probably do for a living.<br><br>I am stuck with this fundamental question about who controls the sync operation and I was wondering if anyone could enlighten me. <br><br>This is a one way sync operation, with the master CVS vault being pushed to another host. This seems to be a typical application for rsync so that is what I am going with.<br><br>The files to be synced are read from a file in the master host. The files themselves are also in the master host.<br><br>The question is, do I run a push operation from the master host, or a pull from the mirrored host?<br><br>When I use a push operation, I am concerned about leaving the mirrored CVS vault in an inconsistent state if there is a problem with the comms.<br><br>The issue might be easily solved by running a pull operation from the mirrored host. However, I would have to hard-code the master paths in the script running from the mirrored host which I would like to avoid if at all possible (I have full control of the master host; I won't have full control of the mirrored host). Over and above that, I am not sure how I would read the file with the list of files to sync from the master/remote host. I don't think I can use '--files-from' with a path on the remote (master) host.<br><br>So, what would you say is best practice for this case?<br><br>1. Push from the master host, perhaps using temporary files on the mirrored host to flag the start and successful completion of the sync operation?<br><br>2. Pull from the mirrored host (with the caveats as per above)<br><br>3. None of the above. The solution is...<br><br>Thanks in advance<br>TM<br><br>PS. Possible rsync commands:<br><br>Push:<br>rsync -varz --delete \<br>    --timeout=30 \<br>    --files-from=/path/local/list_to_sync.txt \<br>    /path/local/dir \<br>    remoteuser@remotehost:/path/remote/dir<br><br>Pull (I could I make this work?)<br>rsync -varz --delete \<br>    --timeout=30 \<br>    --files-from=remoteuser@remotehost:/path/remote/list_to_sync.txt \<br>    remoteuser@remotehost:/path/remote/dir \<br>    /path/local/dir<br><br><br><br></div>