Browse Source

Docs: Improve logging in example automation script (#4226)

docs: improve logging in example automation script

* add an info entry for the compacting step
* add a final info entry for successful completion
Greg Grossmeier 6 years ago
parent
commit
b311b62e0d
1 changed files with 9 additions and 9 deletions
  1. 9 9
      docs/quickstart.rst

+ 9 - 9
docs/quickstart.rst

@@ -220,6 +220,8 @@ backed up and that the ``prune`` command is keeping and deleting the correct bac
 
     # actually free repo disk space by compacting segments
 
+    info "Compacting repository"
+    
     borg compact
 
     compact_exit=$?
@@ -228,16 +230,14 @@ backed up and that the ``prune`` command is keeping and deleting the correct bac
     global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
     global_exit=$(( compact_exit > global_exit ? compact_exit : global_exit ))
 
-    if [ ${global_exit} -eq 1 ];
-    then
-        info "Backup, Prune and/or Compact finished with a warning"
+    if [ ${global_exit} -eq 0 ]; then
+        info "Backup, Prune, and Compact finished successfully"
+    elif [ ${global_exit} -eq 1 ]; then
+        info "Backup, Prune, and/or Compact finished with warnings"
+    else
+        info "Backup, Prune, and/or Compact finished with errors"
     fi
-
-    if [ ${global_exit} -gt 1 ];
-    then
-        info "Backup, Prune and/or Compact finished with an error"
-    fi
-
+    
     exit ${global_exit}
 
 Pitfalls with shell variables and environment variables