Bug #18333
closedkatello-backup returns with wrong exit code when failing
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1323607
Description of problem:
The katello-backup script calls tar to create backups. If tar is failing, i.e. No space left on device or i.e by just killing the tar process, the backup script returns zero.
As a consequence, the failure of the backups is not reported, in contrary all is looking fine. A restore attempt will fail.
Version-Release number of selected component (if applicable):
katello-common-2.2.0.18-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1./usr/bin/katello-backup /to/small/filesystem
2. tar: Removing leading `/' from member names
gzip: stdout: No space left on device
Done.
Backing up mongo db...
tar: Removing leading `/' from member names
Done.
[..]
- BACKUP Complete, contents can be found in: /backup **
[root@sat ~]#
3. echo $?
Actual results:
0
Expected results:
1 (or anything else non-zero
Additional info:
The script should look something like:
tar --selinux -czf config_files.tar.gz ${CONFIGS[*]} || exit $? to catch the exit code of tar
Updated by Christine Fouant almost 8 years ago
- Project changed from Katello to Packaging
- Category deleted (
Backup & Restore)
Updated by The Foreman Bot almost 8 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello-packaging/pull/379 added
Updated by Eric Helms over 7 years ago
- Project changed from Packaging to Katello
- Pull request deleted (
https://github.com/Katello/katello-packaging/pull/379)
Updated by Eric Helms over 7 years ago
- Translation missing: en.field_release set to 211
- Pull request https://github.com/Katello/katello-packaging/pull/379 added
Updated by Christine Fouant over 7 years ago
- Project changed from Katello to Packaging
Updated by Pat Riehecky over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello:katello-packaging|af3a5bc035a23fec778aeaf3e9bfc22116325dff.
Updated by The Foreman Bot over 7 years ago
- Pull request https://github.com/Katello/katello-packaging/pull/405 added
Updated by Christine Fouant over 7 years ago
- Status changed from Closed to Ready For Testing
Updated by Pat Riehecky over 7 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello:katello-packaging|a5593c5ff8cf4a3303d4869240e99eb23db35574.
Updated by Eric Helms over 7 years ago
- Project changed from Packaging to Katello
- Pull request deleted (
https://github.com/Katello/katello-packaging/pull/405, https://github.com/Katello/katello-packaging/pull/379)