The Samba-Bugzilla – Bug 6667
Last modified: 2009-08-27 18:06:58 UTC
someday, perhaps with zfs, file system APIs will offer transaction wrapper functions, something like fio_begn(), fio_cancel(), fio_commit().
In the meantime (another 10 years?) until that happy day arrives, rsync could fake an almost transactional update in the following manner: instead of creating hidden files as you go, create a hidden directory at the root of the tree containing all files being transferred. Populate this new tree with transferred files, then when all have been transferred, hard link all the rest of the files from the existing tree into the new tree. Finally, rename the existing tree to a backup name, rename the new tree into place, then rm -rf the renamed old tree.
--transaction and --partial would work well together.
Except that assumes rsync will never traverse a filesystem boundary. Be very careful about your assumptions...
The "atomic-rsync" script distributed with rsync in the "support" dir does what you propose.