Update nodemgmt-scripts.sh
This commit is contained in:
@@ -23,17 +23,15 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
BACKUP(){
|
BACKUP(){
|
||||||
backupfolder=/opt/idssys/backups/node-backup/$(date +%m-%d-%y)/$(date +%H-%M-%S)
|
BACKUP_FOLDER=${NM_BACKUP_FOLDER}/node-backup/$(date +%m-%d-%y)/$(date +%H-%M-%S)
|
||||||
#BACKUP_FOLDER=/opt/idssys/backups/node-backups/${NODE_HOSTNAME} #/`date +%Y-%m-%d`
|
[ ! -d ${BACKUP_FOLDER} ] && mkdir -p ${BACKUP_FOLDER}
|
||||||
#BACKUP_TIMEFOLDER=${BACKUP_DAYFOLDER}/`date +%H-%M`
|
|
||||||
echo
|
echo
|
||||||
echo -e "${idsCL[Yellow]}Backup Path: ${idsCL[Yellow]}${BACKUP_FOLDER}${idsCL[Default]}\n\n"
|
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]}"
|
echo -e "${idsCL[Green]}Backing up Node Settings and Files...${idsCL[Default]}"
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
[ ! -d ${BACKUP_FOLDER} ] && mkdir -p ${BACKUP_FOLDER}
|
|
||||||
for item in "${!NM_BACKUP_ITEMS[@]}"; do
|
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
|
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
|
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
|
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]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user