From 10ec8ea83ff60a4aaf3d5c86e45fd54ce52c6e12 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 15 Feb 2020 23:35:06 -0600 Subject: [PATCH] Update mysqlbu-scripts.sh --- mysqlbu-scripts.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/mysqlbu-scripts.sh b/mysqlbu-scripts.sh index af1494d..945792b 100755 --- a/mysqlbu-scripts.sh +++ b/mysqlbu-scripts.sh @@ -168,23 +168,25 @@ DELETE_MENU() { echo -e "${idsCL[LightYellow]}========== Select Which Backup to Delete ==========${idsCL[Default]}" tba=1 for day in $BACKUP_PATH/* ; do - #tdt=`sed 's/.*\///' <<< $day` - tdt=`echo $day | sed 's/.*\///'` - bsz=`du -sh ${day} | awk '{print $1}'` - echo -e "${idsBG[Blue]}${idsCL[LightYellow]}(${tba})${idsCL[White]} -> `date -d"${tdt}" +"%A, %B %d, %Y"` - ${bsz} ${idsCL[Default]}${idsBG[Default]}" - tbb=0 - for hour in $day/* ; do - #thr=`sed 's/.*\///' <<< ${hour//_BASE/}` - thr=`echo ${hour//_BASE/} | sed 's/.*\///'` - bsz=`du -sh ${hour} | awk '{print $1}'` - if [ ${hour: -5} = "_BASE" ]; then - echo -e "${idsCL[LightYellow]}(${tba}${abet[${tbb}]^^})${idsCL[LightGreen]}${idsST[Bold]} -> `date -d"${tdt} ${thr//-/:}" +"%H:%M"` - FULL BACKUP${idsST[Reset]}${idsCL[LightGreen]} - ${bsz}${idsCL[Default]}" - else - echo -e "${idsCL[LightYellow]}(${tba}${abet[${tbb}]^^})${idsCL[Cyan]} -> `date -d"${tdt} ${thr//-/:}" +"%H:%M"` - Incremental - ${bsz}${idsCL[Default]}" - fi - tbb=`expr $tbb + 1` - done - tba=`expr $tba + 1` + if [ "${day}" != "${BACKUP_PATH}/latest" ]; then + #tdt=`sed 's/.*\///' <<< $day` + tdt=`echo $day | sed 's/.*\///'` + bsz=`du -sh ${day} | awk '{print $1}'` + echo -e "${idsBG[Blue]}${idsCL[LightYellow]}(${tba})${idsCL[White]} -> `date -d"${tdt}" +"%A, %B %d, %Y"` - ${bsz} ${idsCL[Default]}${idsBG[Default]}" + tbb=0 + for hour in $day/* ; do + #thr=`sed 's/.*\///' <<< ${hour//_BASE/}` + thr=`echo ${hour//_BASE/} | sed 's/.*\///'` + bsz=`du -sh ${hour} | awk '{print $1}'` + if [ ${hour: -5} = "_BASE" ]; then + echo -e "${idsCL[LightYellow]}(${tba}${abet[${tbb}]^^})${idsCL[LightGreen]}${idsST[Bold]} -> `date -d"${tdt} ${thr//-/:}" +"%H:%M"` - FULL BACKUP${idsST[Reset]}${idsCL[LightGreen]} - ${bsz}${idsCL[Default]}" + else + echo -e "${idsCL[LightYellow]}(${tba}${abet[${tbb}]^^})${idsCL[Cyan]} -> `date -d"${tdt} ${thr//-/:}" +"%H:%M"` - Incremental - ${bsz}${idsCL[Default]}" + fi + tbb=`expr $tbb + 1` + done + tba=`expr $tba + 1` + fi done echo -e "${idsCL[Yellow]}===================================================${idsCL[Default]}" echo ""