Wayne,

It would be nice if support/atomic-rsync supported the technique below
(which is actually atomic) in addition to or instead of the current
technique.  Shall I implement this?

Matt

On 4/26/07, Matt McCutchen <[EMAIL PROTECTED]> wrote:
If you're concerned about concurrent access to the repository while
the mirroring is in progress, you can use a symlink to do an atomic
cutover:

# one-time setup (not safe for concurrent access)
mv rep_a rep_a.0
ln -s rep_a.0 rep_a

# sync
oldr=$(readlink rep_a)
newr=${oldr%.*}.$((1-${oldr##*.}))
rsync -a --link-dest=../$oldr/ src/ $newr/
ln -s $newr rep_a.tmp
mv -T rep_a.tmp rep_a
rm -r $oldr

This is a slight improvement of the technique used by the script
"support/atomic-rsync" in the rsync source tree.
--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to