Update mm-scripts.sh

This commit is contained in:
2023-07-10 21:25:16 -05:00
parent d9fb4e8c44
commit b7a86749fa

View File

@@ -1164,8 +1164,6 @@ SERVICEBACKUPSTART(){
SERVICERESTORE(){
srvc=${1}
BACKUPDIR=${MM_BACKUP_FOLDER}/${srvc}
[ -f ${BACKUPDIR}/app-full.tgz ] && fcheck=app || fcheck=cfg
if [ "${srvc}" == "" ]; then
echo
@@ -1186,31 +1184,34 @@ SERVICERESTORE(){
echo
fi
echo "HERE: ${bsrvcs[${srvc}]}"
fulldate=$(date -r ${BACKUPDIR}/${fcheck}-full.tgz "+%y-%m-%d-%H-%M-%S")
IFS='-'; read -a full_date <<< "${fulldate}"; unset IFS
if [ ${full_date[3]} -gt 12 ]; then hr=`expr ${full_date[3]} - 12`; ma=pm; else hr=${full_date[3]}; ma=am; fi; [ ${hr} -lt 10 ] && hr=" ${hr}"
fulldate="${full_date[1]}/${full_date[2]}/${full_date[0]} @ ${hr}:${full_date[4]}${ma}"
echo -e "[${idsCL[LightCyan]} 1${idsCL[Default]}]${idsCL[White]} ${fulldate} - Full Backup${idsCL[Default]}"
if [ "${srvc}" != "" ]; then
BACKUPDIR=${MM_BACKUP_FOLDER}/${srvc}
[ -f ${BACKUPDIR}/app-full.tgz ] && fcheck=app || fcheck=cfg
fulldate=$(date -r ${BACKUPDIR}/${fcheck}-full.tgz "+%y-%m-%d-%H-%M-%S")
IFS='-'; read -a full_date <<< "${fulldate}"; unset IFS
if [ ${full_date[3]} -gt 12 ]; then hr=`expr ${full_date[3]} - 12`; ma=pm; else hr=${full_date[3]}; ma=am; fi; [ ${hr} -lt 10 ] && hr=" ${hr}"
fulldate="${full_date[1]}/${full_date[2]}/${full_date[0]} @ ${hr}:${full_date[4]}${ma}"
echo -e "[${idsCL[LightCyan]} 1${idsCL[Default]}]${idsCL[White]} ${fulldate} - Full Backup${idsCL[Default]}"
f=2
for bakfile in ${BACKUPDIR}/${fcheck}.*.tgz; do
fname=${bakfile##*/}
fdate=${fname#*.}; fdate=${fdate%.*}
IFS='-'; read -a f_date <<< "${fdate}"; unset IFS
if [ ${f_date[3]} -gt 12 ]; then hr=`expr ${f_date[3]} - 12`; ma=pm; else hr=${f_date[3]}; ma=am; fi; [ ${hr} -lt 10 ] && hr=" ${hr}"
fdate="${f_date[1]}/${f_date[2]}/${f_date[0]} @ ${hr}:${f_date[4]}${ma}"
[ $f -lt 10 ] && df=" $f" || df=$f
echo -e "[${idsCL[LightCyan]}${df}${idsCL[Default]}]${idsCL[White]} ${fdate} - Incremental Backup${idsCL[Default]}"
f=2
for bakfile in ${BACKUPDIR}/${fcheck}.*.tgz; do
fname=${bakfile##*/}
fdate=${fname#*.}; fdate=${fdate%.*}
IFS='-'; read -a f_date <<< "${fdate}"; unset IFS
if [ ${f_date[3]} -gt 12 ]; then hr=`expr ${f_date[3]} - 12`; ma=pm; else hr=${f_date[3]}; ma=am; fi; [ ${hr} -lt 10 ] && hr=" ${hr}"
fdate="${f_date[1]}/${f_date[2]}/${f_date[0]} @ ${hr}:${f_date[4]}${ma}"
[ $f -lt 10 ] && df=" $f" || df=$f
echo -e "[${idsCL[LightCyan]}${df}${idsCL[Default]}]${idsCL[White]} ${fdate} - Incremental Backup${idsCL[Default]}"
f=$((f+1))
f=$((f+1))
done
done
echo
echo -en "${idsCL[LightCyan]}Select a backup to restore: ${idsCL[White]}"
read restore
echo
echo -en "${idsCL[LightCyan]}Select a backup to restore: ${idsCL[White]}"
read restore
fi
}
SHOWSRVCUPDATES(){