Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-05 12:37:42 -06:00
parent 74ad7942ea
commit f83f184659

View File

@@ -140,8 +140,10 @@ LISTCERTS(){
BACKUP(){
BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d`
#BACKUP_TIMEFOLDER=${BACKUP_DAYFOLDER}/`date +%H-%M`
echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}"
DIVIDER true
if [ "${action}" != "backup" ]; then
echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}"
DIVIDER true
fi
if [ ! -d ${BACKUP_FOLDER} ]; then
mkdir -p ${BACKUP_FOLDER}
fi
@@ -153,14 +155,19 @@ BACKUP(){
#BACKUP_ITEMS[webserver-files]=/var/www
for item in "${!BACKUP_ITEMS[@]}"
do
echo -en "Backing up '${item}'... "
if [ "${action}" != "backup" ]; then
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'
echo -e "${idsCL[Green]}Ok${idsCL[Default]}"
if [ "${action}" != "backup" ]; then
echo -e "${idsCL[Green]}Ok${idsCL[Default]}"
fi
done
echo ""
DIVIDER true
if [ "${action}" != "backup" ]; then
echo ""
DIVIDER true
fi
if [ -z $action ] || [ "${action}" = "gui" ]; then
ENTER2CONTINUE
fi