mirror of
https://github.com/bashclub/bashclub-zfs-push-pull.git
synced 2024-11-07 21:01:58 +01:00
fail early if destination fs doesn't exist
zfs receive will fail, but the source snapshot has already been created, and the rotation/cleanup of old snapshots will be triggered
This commit is contained in:
parent
48f905f0e2
commit
12f7666a2f
@ -109,6 +109,11 @@ destfs="${dest#*:}"
|
|||||||
# get the last src component
|
# get the last src component
|
||||||
srcbase="${srcfs##*/}"
|
srcbase="${srcfs##*/}"
|
||||||
|
|
||||||
|
# ensure the destination fs exists before proceeding
|
||||||
|
if [[ $(ZFS "$desthost" list -H -o name "$destfs" 2>/dev/null) != $destfs ]] ; then
|
||||||
|
die 1 "destination fs '$destfs' doesn't exist"
|
||||||
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
### create new snapshot on src
|
### create new snapshot on src
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user