<p dir="ltr">rsync -av /src/ /dst/ && touch /dst/done</p>
<p dir="ltr">That should do it as the touch only happens if rsync exits with a code of 0.  If you need to consider other non zero exit code, it is still doable, just a bit more shell code.</p>
<p dir="ltr">There are surely other options as well, but this is probably the most simple.</p>
<div class="gmail_quote">On Apr 28, 2015 3:47 AM, "Simon Hobson" <<a href="mailto:linux@thehobsons.co.uk">linux@thehobsons.co.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As part of my backup system, I use Rsync to keep a copy of each server on one central backup server. This backup server then uses StoreBackup to keep multiple iterations of each clone directory.<br>
So that the StoreBackup archives don't keep adding "redundant" and misleading backups, I update a flag file with the current date/time before doing the Rsync update, and test to see if this file is newer than the one in the latest StoreBackup backup. If it isn't, then I skip the StoreBackup for that server.<br>
<br>
The end result is that if a system is down or out of communication (one or two are at sites that can be offline for days), then the list of backups in StoreBackup will reflect that. Eg, if the system did a sync on the 1st, but not on 2nd - 5th, then there will be no backups for 2nd-5th, and when looking later I won't be "fooled" into thinking that I have a backup from (say) the 4th.<br>
<br>
Where this breaks down is if the sync fails part way through. The flag file has already been synced, so I have multiple backups which aren't actually complete.<br>
I actually have this at the moment. Just put a small system on a customer site, it has a database that creates 1GB journal files (not that it handles anything like that volume of data), and at the moment their connectivity is a bit flakey.<br>
<br>
My first thought was "do the flag file last", but a quick search confirms what I thought - that there isn't an option for this.<br>
<br>
So, does anyone have any suggestions how I might reasonably easily get the ability for my script to see if the previous sync completed ?<br>
<br>
<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/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
</blockquote></div>