Yes, it&#39;ll sync the source directory (now empty) to Server B, deleting everything due to the --delete option.<br><br>One solution I use is to place a check for the existence of a subdirectory just before the rsync command in the script.  This was you can make rsync contingent on the existence of that subdirectory, possibly notifying you via email when it is not there.<br>
<br>So if you had a subdirectory named &quot;data&quot; directly in the folder you&#39;re syncing, your script (bash) would have something like the following:<br><br><b>rsync --list server::folder/data 1&gt;/dev/null 2&gt;/dev/null<br>
if [ $? eq 0 ] <br>  then<br>    <span lang="EN-US">rsync -a –delete server::folder  /folder</span><br>  else<br>    mutt -nx -s &quot;rsync skipped due to missing directory!&quot; &lt;youremail&gt;<br>fi<br></b><br>The idea is that you first tell rsync to list all files under the folder/data directory.  If that directory doesn&#39;t exist, the command will fail with a non-zero exit value.  This is precisely what you check in the if conditional.  Now your rsync will either sync properly with the assurance that the source folder is still there, or notify you via email.<br>
<br>These commands, exit values, etc should all be tested on your server.  You may not even have mutt installed, or an MTA (ie: Postfix) configured.  Testing is key.<br><br><div class="gmail_quote">On Thu, Mar 18, 2010 at 8:46 AM, Christian Röder <span dir="ltr">&lt;<a href="mailto:cr@strassenfeger.tv">cr@strassenfeger.tv</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="DE"><div><p><span lang="EN-US">I was just pondering:</span></p>
<p><span lang="EN-US"> </span></p><p><span lang="EN-US">Lets look at Server A with one extra harddisc hdb, where hdb1 is mounted at /mnt/folder.</span></p><p><span lang="EN-US">/mnt/folder is the folder which should be mirrored on Server B.</span></p>
<p><span lang="EN-US">So Server B rsyncs </span></p><p><span lang="EN-US"> </span></p><p><span lang="EN-US">rsynch -a –delete server::folder  /folder</span></p><p><span lang="EN-US"> </span></p><p><span lang="EN-US">from Server A and gets all the new files and deletes all the files, which doesn&#39;t exist on Server A&#39;s /mnt/folder anymore. </span></p>
<p><span lang="EN-US"> </span></p><p><span lang="EN-US">What would happen, if the harddisc hdb would fail?</span></p><p><span lang="EN-US">Will this happen?:</span></p><p><span lang="EN-US"> </span></p><p><span lang="EN-US">harddisc hdb failes</span></p>
<p><span lang="EN-US">hdb1 is not automatically mounted at /mnt/folder </span></p><p><span lang="EN-US">Server B rsyncs from Server A, but /mnt/folder is empty, so rsync deletes every file in the mirror folder on Server B?</span></p>
<p><span lang="EN-US"> </span></p><p><span lang="EN-US">Are my assumptions correct?</span></p><p><span lang="EN-US"> </span></p><p><span lang="EN-US">Thanks in advance, </span></p><p><span lang="EN-US"> </span></p><font color="#888888"><p>
Christian</p><p class="MsoNormal"> </p></font></div></div><br>--<br>
Please use reply-all for most replies to avoid omitting the mailing list.<br>
To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/%7Eesr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br></blockquote></div><br>