Update nodemgmt-scripts.sh

This commit is contained in:
2023-05-13 22:53:29 -05:00
parent e3bb4b8260
commit 97d1b1904a

View File

@@ -105,29 +105,31 @@ BACKUP(){
BACKUP_FOLDER=/opt/idssys/backups/node-backup
#BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d`
#BACKUP_TIMEFOLDER=${BACKUP_DAYFOLDER}/`date +%H-%M`
if [ "${action}" != "backup" ]; then
# if [ "${action}" != "backup" ]; then
echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}"
DIVIDER true
fi
# fi
if [ ! -d ${BACKUP_FOLDER} ]; then
mkdir -p ${BACKUP_FOLDER}
fi
for item in "${!BACKUP_ITEMS[@]}"
do
if [ "${action}" != "backup" ]; then
for item in "${!BACKUP_ITEMS[@]}"; do
if [ -d ${BACKUP_ITEMS[$item]} ]; then
# [ "${action}" != "backup" ] &&
echo -en "Backing up '${item}'... "
fi
#tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} .
tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -g ${BACKUP_FOLDER}/backup.snar -C ${BACKUP_ITEMS[$item]} . --exclude='./data/repository' --exclude='*/.stfolder' --exclude='*/.stversions' --exclude='*/.git'
if [ "${action}" != "backup" ]; then
#tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} .
tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -g ${BACKUP_FOLDER}/backup.snar -C ${BACKUP_ITEMS[$item]} . --exclude='./data/repository' --exclude='*/.stfolder' --exclude='*/.stversions' --exclude='*/.git'
# [ "${action}" != "backup" ] &&
echo -e "${idsCL[Green]}Ok${idsCL[Default]}"
else
# [ "${action}" != "backup" ] &&
echo -e "Not backing up '${item}', not found."
fi
done
touch ${FOLDER}/backup.lastrun
if [ "${action}" != "backup" ]; then
# if [ "${action}" != "backup" ]; then
echo ""
DIVIDER true
fi
# fi
if [ -z $action ] || [ "${action}" = "gui" ]; then
ENTER2CONTINUE
fi