Closed oddlama closed 2 years ago
thanks! ill fix it right away. usually i send the exit code to my zabbix server.
errors are send to stderr: so when everything goes perfectly there should be no output, maybe you can use that?
Thanks for the swift response and fix! Don't worry about my specific case, that was a one-off error caused by me anyway. I was just wondering why the error didn't trigger an email from the source host (which I send based on failed exit code), I personally don't actually need to know the amount of failed datasets. Still glad that it's fixed now :)
I know, but i treat it as very a serious bug: an exit 0 should be 100% reliable.
Correct and reliable error handling in zfs-autobackup has the highest priority, as it should be in a backup tool.
Due to a bad remote pool configuration I recently had the pleasure of failing an autobackup of exactly
256
datasets. This resulted infail_count = 256
inZfsAutobackup
. When this was passed tosys.exit()
it is equivalent tosys.exit(0)
due to an integer overflow (exit codes in linux are stored as auint8_t
).I'd argue against returning the number of failed snapshots via the exit code, as this will report wrong information if many datasets are involved (anything >=255 seems problematic). It might be better to present parseable information in the output in such a case and dedicate an exit code (
2
?) for the general failure condition.