Update mm-scripts.sh
This commit is contained in:
@@ -1064,7 +1064,10 @@ SERVICEBACKUP(){
|
||||
[ ! -d ${BACKUPDIR} ] && mkdir -p ${BACKUPDIR}
|
||||
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^}
|
||||
|
||||
if [ "${2}" == "-f" ] || [ $(expr `date +%s` - $(stat -c %Y ${LOGFOLDER}/update.${usrvc})) -gt 7776000 ] || ([ ! -f ${BACKUPDIR}/cfg.tgz ] && [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]) || ([ ! -f ${BACKUPDIR}/app.tgz ] && [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]); then
|
||||
if [ "${2}" == "-f" ] ||
|
||||
([ ! -f ${BACKUPDIR}/cfg.tgz ] && [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ]) ||
|
||||
([ ! -f ${BACKUPDIR}/app.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
|
||||
if [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]; then
|
||||
rm -f ${BACKUPDIR}/snapshot-apt.snar
|
||||
tar -cpPg ${BACKUPDIR}/snapshot-apt.snar -f ${BACKUPDIR}/app.tgz ${APPBAKFOLDER}
|
||||
@@ -1073,7 +1076,7 @@ SERVICEBACKUP(){
|
||||
rm -f ${BACKUPDIR}/snapshot-cfg.snar
|
||||
tar -cpPg ${BACKUPDIR}/snapshot-cfg.snar -f ${BACKUPDIR}/cfg.tgz ${MM_SERVICE_CFG[${usrvc}]}
|
||||
fi
|
||||
|
||||
touch ${BACKUPDIR}/fullbackup
|
||||
else
|
||||
if [ "${MM_SERVICE_APP[$usrvc]}" != "none" ]; then
|
||||
tar -cpPg ${BACKUPDIR}/snapshot-apt.snar -f ${BACKUPDIR}/app.$(date +%y-%m-%d-%H-%M-%S).tgz ${APPBAKFOLDER}
|
||||
|
||||
Reference in New Issue
Block a user