-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All further snapshots are aborted after the --pre-snapshot= command fails once. #81
Comments
mateusz-kolecki
added a commit
to mateusz-kolecki/zfs-auto-snapshot
that referenced
this issue
Nov 20, 2021
…shot command failed once
daniel-ayers
added a commit
to daniel-ayers/zfs-auto-snapshot
that referenced
this issue
Jun 7, 2022
…lti-targets Fix zfsonlinux#81 - further snapshots were aborted after the pre-snapshot comma…
GrayXu
added a commit
to GrayXu/zfs-auto-snapshot
that referenced
this issue
Mar 20, 2023
…lti-targets Fix zfsonlinux#81 - further snapshots were aborted after the pre-snapshot comma…
Guiorgy
pushed a commit
to Guiorgy/zfs-auto-snapshot
that referenced
this issue
Aug 23, 2024
…shot command failed once
Guiorgy
pushed a commit
to Guiorgy/zfs-auto-snapshot
that referenced
this issue
Aug 24, 2024
…shot command failed once
Guiorgy
pushed a commit
to Guiorgy/zfs-auto-snapshot
that referenced
this issue
Aug 24, 2024
…shot command failed once
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: