Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lpirl
Copy link
Contributor

@lpirl lpirl commented May 6, 2019

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:

btrfs-snap/btrfs-snap

Lines 183 to 186 in 7126515

function log.info() {
logger -p ${LOG_FACILITY}.info -t ${prog} "$1"
test -z "$quiet" && echo "$1"
}
) which does not "mask" negative exit codes of test.

@lpirl
Copy link
Contributor Author

lpirl commented Apr 11, 2020

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant