[Bug 44194] New: koha-dump --quiet exits 1 after every successful dump
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 Bug ID: 44194 Summary: koha-dump --quiet exits 1 after every successful dump Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Target Milestone: --- The last line of dump_instance in debian/scripts/koha-dump is [ "$quiet" = "no" ] && echo "Done." With --quiet the test is false, so the line, and with it the function, returns 1; the script runs under set -e and exits 1. The dump itself is complete. Any cron job or monitoring that runs koha-dump --quiet and checks the exit status therefore sees a failure after every good backup, which teaches people to ignore the alert. To reproduce (main): 1. sudo koha-dump --quiet kohadev ; echo $? 2. Prints 1. The .sql.gz and .tar.gz in /var/spool/koha/kohadev are complete. 3. sudo koha-dump kohadev ; echo $? prints Done. and 0. Expected: 0 after a successful dump, with or without --quiet. Reproduced on main (6ff8078) and on Koha 26.05.02. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212183&action=edit Bug 44194: Exit 0 from koha-dump --quiet after a successful dump Bug 44194: Exit 0 from koha-dump --quiet after a successful dump The last line of dump_instance, [ "$quiet" = "no" ] && echo "Done.", returns 1 when --quiet is given, and under set -e the script exits 1 after a complete dump. Use an if instead. Test plan: 1. sudo koha-dump --quiet kohadev ; echo $? Without the patch: 1. With the patch: 0. 2. sudo koha-dump kohadev ; echo $? still prints Done. and 0. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 John Vinke <jvinke@austinseminary.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Koha Solutions list of Sponsors| | Sponsorship status|--- |Sponsored Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 John Vinke <jvinke@austinseminary.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212183|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44194 --- Comment #2 from John Vinke <jvinke@austinseminary.edu> --- Created attachment 212445 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212445&action=edit Bug 44194: Exit 0 from koha-dump --quiet after a successful dump The last line of dump_instance, [ "$quiet" = "no" ] && echo "Done.", returns 1 when --quiet is given, and under set -e the script exits 1 after a complete dump. Use an if instead. Test plan: 1. sudo koha-dump --quiet kohadev ; echo $? Without the patch: 1. With the patch: 0. 2. sudo koha-dump kohadev ; echo $? still prints Done. and 0. Sponsored-by: Koha Solutions Signed-off-by: John Vinke <jvinke@austinseminary.edu> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org