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-backup
#BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d` #BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d`
#BACKUP_TIMEFOLDER=${BACKUP_DAYFOLDER}/`date +%H-%M` #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]}" echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}"
DIVIDER true DIVIDER true
fi # fi
if [ ! -d ${BACKUP_FOLDER} ]; then if [ ! -d ${BACKUP_FOLDER} ]; then
mkdir -p ${BACKUP_FOLDER} mkdir -p ${BACKUP_FOLDER}
fi fi
for item in "${!BACKUP_ITEMS[@]}" for item in "${!BACKUP_ITEMS[@]}"; do
do if [ -d ${BACKUP_ITEMS[$item]} ]; then
if [ "${action}" != "backup" ]; then # [ "${action}" != "backup" ] &&
echo -en "Backing up '${item}'... " echo -en "Backing up '${item}'... "
fi #tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} .
#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'
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" ] &&
if [ "${action}" != "backup" ]; then
echo -e "${idsCL[Green]}Ok${idsCL[Default]}" echo -e "${idsCL[Green]}Ok${idsCL[Default]}"
else
# [ "${action}" != "backup" ] &&
echo -e "Not backing up '${item}', not found."
fi fi
done done
touch ${FOLDER}/backup.lastrun touch ${FOLDER}/backup.lastrun
if [ "${action}" != "backup" ]; then # if [ "${action}" != "backup" ]; then
echo "" echo ""
DIVIDER true DIVIDER true
fi # fi
if [ -z $action ] || [ "${action}" = "gui" ]; then if [ -z $action ] || [ "${action}" = "gui" ]; then
ENTER2CONTINUE ENTER2CONTINUE
fi fi