From: MegaBrutal Date: Sat, 15 Aug 2015 02:52:28 +0000 (+0200) Subject: mysqlbak_check.sh: Truncate file list and show summary X-Git-Url: http://git.megabrutal.com/?p=mgsautils.git;a=commitdiff_plain;h=0ff0a58157fc0acd3e9ab407ce8be25bcea01a97;hp=01154dccd3a2f80cba40c5dfab1b3b86f521494d mysqlbak_check.sh: Truncate file list and show summary Changed MySQL backup check script to truncate file lists (only show 20 files of the most recent and the oldest backups) and show statistics (file number and summarized size) at the end of each directory listing. modified: mysqlbak_check.sh --- diff --git a/mysql/mysqlbak_check.sh b/mysql/mysqlbak_check.sh index ca63a58..48c7bea 100755 --- a/mysql/mysqlbak_check.sh +++ b/mysql/mysqlbak_check.sh @@ -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