mysqlbak_check.sh: Truncate file list and show summary
[mgsautils.git] / mysql / mysqlbak_check.sh
index ca63a5803f84eadab58da2ac4f2a908e44180bdd..48c7beabb01d9c7b14e0b6394a74566cc17a055d 100755 (executable)
@@ -2,6 +2,7 @@
 # By MegaBrutal
 #
 # Changelog:
+# 2015-08-15: Truncate file lists and show statistics
 # 2014-09-13: Changed bzip2 test to tar tvf
 # 2014-01-03: Last known modification before changelog
 
@@ -48,8 +49,15 @@ do
        fi
        echo
        echo
-       echo "Other backup files present (most recent at top):"
-       ls -lt ${BAKDIR}/*
+       echo "Recent 20 backups:"
+       ls -lt ${BAKDIR}/* | head -20
+       echo
+       echo "Oldest 20 backups:"
+       ls -lt ${BAKDIR}/* | tail -20
+       echo
+       echo
+       DU=$(du -sb ${BAKDIR} | cut -f1)
+       echo "Total number of files: $(ls -1 ${BAKDIR} | wc -l), taking ${DU} bytes ($(expr ${DU} / 1048576) megabytes) of disk space."
        echo
        echo
        echo