zfs-scripts
zfs-scripts copied to clipboard
problem when a dataset has same name as a pool
Hi nice script. But there could be problems if you have a dataset with the same name as a pool.
so, in check_last_source_snap() last_snap_source=$( zfs list -o name -t snapshot -H 2> $0.err | grep $SRC_PATH@ | tail -1 ) should be : last_snap_source=$( zfs list -o name -t snapshot -H 2> $0.err | grep ^$SRC_PATH@ | tail -1 )
Same goes for check_last_target_snap()
Michel
I'll take a look asap and fix it.