This commit is contained in:
2023-07-09 22:57:23 -05:00
parent c416b3317a
commit afe6be5786
2 changed files with 13 additions and 23 deletions

View File

@@ -1103,7 +1103,7 @@ SERVICEBACKUP(){
msg="Backing Up Service"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
BACKUPDIR=${NM_BACKUP_FOLDER}/${usrvc}
BACKUPDIR=${MM_BACKUP_FOLDER}/${usrvc}
[ ! -d ${BACKUPDIR} ] && mkdir -p ${BACKUPDIR}
[ "${usrvc}" == "radarr" ] && [ ! -d ${BACKUPDIR}3d ] && mkdir -p ${BACKUPDIR}3d
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^}
@@ -1145,20 +1145,7 @@ SERVICEBACKUP(){
fi
fi
}
SERVICEBACKUP.old(){
usrvc=${1}
msg="Stopping Service and Backing Up"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
/bin/systemctl stop ${usrvc} >> ${LOGFOLDER}/update.${usrvc}
[ "${usrvc}" == "radarr" ] && /bin/systemctl stop radarr3d >> ${LOGFOLDER}/update.${usrvc}
bak=/opt/Backups/${usrvc}.opt.tgz
bakcfg=/opt/Backups/${usrvc}.cfg.tgz
[[ -f ${bak} ]] && rm -f "${bak}" &>/dev/null
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && bkfldr=${MM_SERVICE_APP[$usrvc]} || bkfldr=/opt/${usrvc^}
[ "${MM_SERVICE_APP[$usrvc]}" != "none" ] && /bin/tar -cpPf $bak ${bkfldr} >> ${LOGFOLDER}/update.${usrvc}
[ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ] && /bin/tar -cpPf $bakcfg ${MM_SERVICE_CFG[${usrvc}]} >> ${LOGFOLDER}/update.${usrvc}
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
}
SERVICEBACKUPSTART(){
msg="Starting Service"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"