Small utility in Go to synchronize snapshots recursively from a source to a destination. Both source and destination can be a remote or local file system.
Note that
- the given FS should already be present on the destination.
- You need SSH to be set up either via ssh agent or keyfile, user/password will not work
Flags:
--recursiveor-r: synchronize file systems recursively and create missing file systems on the destination.--forceor-f: revert file systems to the most recent snapshot before receiving the data (zfs recv -F).--progressor-p: display a progress bar for each snapshot transfer.--compressionor-c: set the compression for SSH (yes/no).
Examples:
zfs-snapback [email protected]:remote/zfs/fs/path local/fs/path
zfs-snapback one/local/fs another/local/fs
zfs-snapback local/fs/path [email protected]:remote/zfs/fs/path
zfs-snapback [email protected]:remote/zfs/fs/path [email protected]:zpool/backups/source.tld
- Testing
- Complete error handling
- Use
zfs send -Iinstead of multiple calls tozfs send -i