What a great script! That's exactly what we were looking for when we planned to move away from our existing rsync-based solution under ext4 on Proxmox VE (Debian Linux based virtualization platform for OpenVZ & KVM). Very nice, you're providing this great script to the community. Thanks.
We are not yet running ZFS/ZREP in production but the flags are all green to start soon, since Proxmox VE 3.4 introduced ZFS support with the latest ZFSOnLinux built in.
One thing that did not work on ZFSOnLinux, obviously was the detection of Z_HAS_X / Z_HAS_SNAPPROPS / DEPTHCAP in zrep_vars, lines 45-78. As a quickfix, we were simply overriding the (wrongly) auto-detected values:
If you could also make the auto-detection of these features compatible with zfs output of ZFSOnLinux, that would be great. Here you go:
$ zfs 2>&1
missing command
usage: zfs command args ...
where 'command' is one of the following:
create [-p] [-o property=value] ... <filesystem>
create [-ps] [-b blocksize] [-o property=value] ... -V <size> <volume>
destroy [-fnpRrv] <filesystem|volume>
destroy [-dnpRrv] <filesystem|volume>@<snap>[%<snap>][,...]
snapshot|snap [-r] [-o property=value] ... <filesystem@snapname|volume@snapname> ...
rollback [-rRf] <snapshot>
clone [-p] [-o property=value] ... <snapshot> <filesystem|volume>
promote <clone-filesystem>
rename [-f] <filesystem|volume|snapshot> <filesystem|volume|snapshot>
rename [-f] -p <filesystem|volume> <filesystem|volume>
rename -r <snapshot> <snapshot>
list [-Hp] [-r|-d max] [-o property[,...]] [-s property]...
[-S property]... [-t type[,...]] [filesystem|volume|snapshot] ...
set <property=value> <filesystem|volume|snapshot> ...
get [-rHp] [-d max] [-o "all" | field[,...]] [-t type[,...]] [-s source[,...]]
<"all" | property[,...]> [filesystem|volume|snapshot] ...
inherit [-rS] <property> <filesystem|volume|snapshot> ...
upgrade [-v]
upgrade [-r] [-V version] <-a | filesystem ...>
userspace [-Hinp] [-o field[,...]] [-s field]...
[-S field]... [-t type[,...]] <filesystem|snapshot>
groupspace [-Hinp] [-o field[,...]] [-s field]...
[-S field]... [-t type[,...]] <filesystem|snapshot>
mount
mount [-vO] [-o opts] <-a | filesystem>
unmount [-f] <-a | filesystem|mountpoint>
share <-a | filesystem>
unshare <-a | filesystem|mountpoint>
send [-DnPpRrv] [-[iI] snapshot] <snapshot>
receive [-vnFu] <filesystem|volume|snapshot>
receive [-vnFu] [-d | -e] <filesystem>
allow <filesystem|volume>
allow [-ldug] <"everyone"|user|group>[,...] <perm|@setname>[,...]
<filesystem|volume>
allow [-ld] -e <perm|@setname>[,...] <filesystem|volume>
allow -c <perm|@setname>[,...] <filesystem|volume>
allow -s @setname <perm|@setname>[,...] <filesystem|volume>
unallow [-rldug] <"everyone"|user|group>[,...]
[<perm|@setname>[,...]] <filesystem|volume>
unallow [-rld] -e [<perm|@setname>[,...]] <filesystem|volume>
unallow [-r] -c [<perm|@setname>[,...]] <filesystem|volume>
unallow [-r] -s @setname [<perm|@setname>[,...]] <filesystem|volume>
hold [-r] <tag> <snapshot> ...
holds [-r] <snapshot> ...
release [-r] <tag> <snapshot> ...
diff [-FHt] <snapshot> [snapshot|filesystem]
Each dataset is of the form: pool/[dataset/]*dataset[@name]
For the property list, run: zfs set|get
For the delegated permission list, run: zfs allow|unallow