From d9f61ab587a83d28ad0706f5dd838e967c575c98 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 14 Nov 2023 14:44:53 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 9ac7ab57..690d8516 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -23,17 +23,15 @@ fi BACKUP(){ - backupfolder=/opt/idssys/backups/node-backup/$(date +%m-%d-%y)/$(date +%H-%M-%S) - #BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d` - #BACKUP_TIMEFOLDER=${BACKUP_DAYFOLDER}/`date +%H-%M` + BACKUP_FOLDER=${NM_BACKUP_FOLDER}/node-backup/$(date +%m-%d-%y)/$(date +%H-%M-%S) + [ ! -d ${BACKUP_FOLDER} ] && mkdir -p ${BACKUP_FOLDER} echo echo -e "${idsCL[Yellow]}Backup Path: ${idsCL[Yellow]}${BACKUP_FOLDER}${idsCL[Default]}\n\n" echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}" DIVIDER true - [ ! -d ${BACKUP_FOLDER} ] && mkdir -p ${BACKUP_FOLDER} for item in "${!NM_BACKUP_ITEMS[@]}"; do c=0; spc=''; spc1=`expr 20 - ${#item}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "Backing up '${item}'${spc}" + echo -en "Backing up '${idsCL[LightCyan]}${item}${idsCL[Default]}'${spc}" if [ -d ${NM_BACKUP_ITEMS[$item]} ]; then tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${NM_BACKUP_ITEMS[$item]} . --exclude='./data/repository' --exclude='*/.stfolder' --exclude='*/.stversions' --exclude='*/.git' --exclude='*.example.*' >/dev/null 2>&1 echo -e "${idsCL[Green]}Done${idsCL[Default]}"