btrfs-snap icon indicating copy to clipboard operation
btrfs-snap copied to clipboard

prevent exit code 1 when deleting a snapshot in quiet mode (-q)

Open lpirl opened this issue 5 years ago • 1 comments

When in quiet mode (i.e., -q is given) false negative exit codes might occur. For example, when snapshots have to be deleted due to rotation. This is especially annoying with (various) cron (implementations), because non-zero exit codes trigger an email being sent although no actual error occurred. The cause might be the line test -z "$quiet" && echo "$1" in function log.info() (e.g., in 1.7.3: https://github.com/jf647/btrfs-snap/blob/7126515e2259c24b29a2a8ba272e7917db5a703c/btrfs-snap#L183-L186) which does not "mask" negative exit codes of test.

lpirl avatar May 06 '19 15:05 lpirl

Since this repository does not seem to be maintained by @jf647 anymore, I meanwhile merged this into https://github.com/lpirl/btrfs-snap/tree/master .

lpirl avatar Apr 11 '20 10:04 lpirl

I agree with problem description as well as solution.

serpedon avatar Jun 21 '24 16:06 serpedon