From 0ff0a58157fc0acd3e9ab407ce8be25bcea01a97 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sat, 15 Aug 2015 04:52:28 +0200 Subject: [PATCH] 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 --- mysql/mysqlbak_check.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 -- 2.34.1