-
Notifications
You must be signed in to change notification settings - Fork 256
Description
Summary
When taking snapshots of multiple datasets using a command with --pre-snapshot= to decide whether to proceed or not, all snapshots are aborted after the first time the command returns non-zero. If the command returns zero for a following dataset the snapshot is still aborted. According to the man-page the snapshot is aborted for -this- dataset.
How to reproduce
Abort any dataset that isn't the last in sequence by returning non-zero from a command specified with --pre-snapshot=.
Expected behavior
Snapshot of dataset is aborted. Datasets following the aborted snapshot are only aborted when the command returns non-zero.
Observed behavior
All further snapshots of dataset are aborted irrespective of command return value.
P.S: RUNSNAP is declared and set to 1 on line 155. RUNSNAP is set to 0 when do_run fails on line 168 and is never set again for the next iterations of the loop. My personal fix was to change line 168 from:
do_run "$opt_pre_snapshot $ii $NAME" || RUNSNAP=0
to:
do_run "$opt_pre_snapshot $ii $NAME" && RUNSNAP=1 || RUNSNAP=0