This commit is contained in:
2023-07-09 12:14:00 -05:00
parent 6bd1bf74cb
commit 2b7a5c1093
2 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='3.8.264-07012023' VERS='3.9.1-07092023'
MMFOLDER="/opt/idssys/mediamanager" MMFOLDER="/opt/idssys/mediamanager"
TMPFOLDER="${MMFOLDER}/.tmp" TMPFOLDER="${MMFOLDER}/.tmp"

View File

@@ -1065,16 +1065,16 @@ SERVICEBACKUP(){
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^} [ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^}
if [ "${2}" == "-f" ] || if [ "${2}" == "-f" ] ||
([ ! -f ${BACKUPDIR}/cfg.tgz ] && [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]) || ([ ! -f ${BACKUPDIR}/cfg-full.tgz ] && [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]) ||
([ ! -f ${BACKUPDIR}/app.tgz ] && [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]) || ([ ! -f ${BACKUPDIR}/app-full.tgz ] && [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]) ||
([ $(expr `date +%s` - $(stat -c %Y ${LOGFOLDER}/update.${usrvc})) -gt 604800 ] && [ $(expr `date +%s` - $(stat -c %Y ${BACKUPDIR}/fullbackup)) -gt 7776000 ]); then ([ $(expr `date +%s` - $(stat -c %Y ${LOGFOLDER}/update.${usrvc})) -gt 604800 ] && [ $(expr `date +%s` - $(stat -c %Y ${BACKUPDIR}/fullbackup)) -gt 7776000 ]); then
if [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]; then if [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]; then
rm -f ${BACKUPDIR}/snapshot-apt.snar rm -f ${BACKUPDIR}/snapshot-apt.snar
tar -cpPg ${BACKUPDIR}/snapshot-apt.snar -f ${BACKUPDIR}/app.tgz ${APPBAKFOLDER} tar -cpPg ${BACKUPDIR}/snapshot-apt.snar -f ${BACKUPDIR}/app-full.tgz ${APPBAKFOLDER}
fi fi
if [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]; then if [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]; then
rm -f ${BACKUPDIR}/snapshot-cfg.snar rm -f ${BACKUPDIR}/snapshot-cfg.snar
tar -cpPg ${BACKUPDIR}/snapshot-cfg.snar -f ${BACKUPDIR}/cfg.tgz ${MM_SERVICE_CFG[${usrvc}]} tar -cpPg ${BACKUPDIR}/snapshot-cfg.snar -f ${BACKUPDIR}/cfg-full.tgz ${MM_SERVICE_CFG[${usrvc}]}
fi fi
touch ${BACKUPDIR}/fullbackup touch ${BACKUPDIR}/fullbackup
else else
@@ -1087,10 +1087,10 @@ SERVICEBACKUP(){
fi fi
for BAKFILE in ${BACKUPDIR}/app.*.tgz; do for BAKFILE in ${BACKUPDIR}/app.*.tgz; do
[ ${BACKUPDIR}/app.tgz -nt ${BAKFILE} ] && rm -f ${BAKFILE} [ ${BACKUPDIR}/app-full.tgz -nt ${BAKFILE} ] && rm -f ${BAKFILE}
done done
for BAKFILE in ${BACKUPDIR}/cfg.*.tgz; do for BAKFILE in ${BACKUPDIR}/cfg.*.tgz; do
[ ${BACKUPDIR}/cfg.tgz -nt ${BAKFILE} ] && rm -f ${BAKFILE} [ ${BACKUPDIR}/cfg-full.tgz -nt ${BAKFILE} ] && rm -f ${BAKFILE}
done done
echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo -e "${idsCL[Green]}Done${idsCL[Default]}"