]> arthur.barton.de Git - backup-script.git/commitdiff
backup-status: Enhance status message
authorAlexander Barton <alex@barton.de>
Tue, 24 Nov 2015 12:03:58 +0000 (13:03 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 24 Nov 2015 12:03:58 +0000 (13:03 +0100)
bin/backup-status

index 68a7d1f8334feab9b4c6d02fb44fff56eca7edc5..6d6173981460377c8687463f4dad76b8d67cf38c 100755 (executable)
@@ -208,12 +208,17 @@ for f in $sys; do
        echo
 done
 
+if [ "$ONLY_ERRORS" != "0" ]; then
+       status="failed "; p0="."; pN="!"
+else
+       status=""; p0="!"; pN="."
+fi
 if [ $count -lt 1 ]; then
-       echo "No backups found!"
+       echo "No ${status}backups found${p0}"
        exit 1
 fi
 [ $count -eq 1 ] && sc="" || sc="s"
 [ $snapshots -eq 1 ] && ss="" || ss="s"
-echo "$count system backup$sc found, $snapshots snapshot$ss."
+echo "$count ${status}system backup$sc found, $snapshots snapshot$ss${pN}"
 
 # -eof-