I was wondering if there is a way to tell rsync to only apply changes (delete, overwrite, create) only if all files in the file list transferred successfully.
Just to clarify, this would essentially be putting a transaction around the transfer.
you could use a filesystem (btrfs, zfs) with snapshot-features:
you can also enroll your own snapshots:
You could use the
--delay-updates option, or if you want really atomic updates, the
atomic-rsync script (included in Debian as
From the 'rsync' man pages, you may be in luck only for deletes:
Some options require rsync to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and --delay-updates. Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0 (use --del or --delete-during to request this improved deletion mode explicitly). See also the --delete-delay option that is a better choice than using --delete-after.