Skip to content

Commit c08f366

Browse files
committed
Abort if pre snapshot hook returns non-zero
1 parent da5a8bd commit c08f366

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/zfs-auto-snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ do_snapshots () # properties, flags, snapname, oldglob, [targets...]
159159
for ii in $TARGETS
160160
do
161161
do_run "$opt_pre_snapshot $ii $NAME"
162-
if do_run "zfs snapshot $PROPS $FLAGS '$ii@$NAME'"
162+
if [ $? -eq 0 ] && do_run "zfs snapshot $PROPS $FLAGS '$ii@$NAME'"
163163
then
164164
do_run "$opt_post_snapshot $ii $NAME"
165165
SNAPSHOT_COUNT=$(( $SNAPSHOT_COUNT + 1 ))

0 commit comments

Comments
 (0)