From ac174e89b48850ba11dab195952793486c538446 Mon Sep 17 00:00:00 2001 From: Greg Grossmeier Date: Fri, 21 Dec 2018 09:54:58 -0800 Subject: [PATCH] Docs: Improve logging in example automation script * add a final info entry for successful completion --- docs/quickstart.rst | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 458464b2d..5a1eb91be 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -219,16 +219,14 @@ backed up and that the ``prune`` command is keeping and deleting the correct bac # use highest exit code as global exit code global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) - if [ ${global_exit} -eq 1 ]; - then - info "Backup and/or Prune finished with a warning" + if [ ${global_exit} -eq 0 ]; then + info "Backup and Prune finished successfully" + elif [ ${global_exit} -eq 1 ]; then + info "Backup and/or Prune finished with warnings" + else + info "Backup and/or Prune finished with errors" fi - - if [ ${global_exit} -gt 1 ]; - then - info "Backup and/or Prune finished with an error" - fi - + exit ${global_exit} Pitfalls with shell variables and environment variables