update
This commit is contained in:
@@ -162,10 +162,11 @@ declare -A NM_BACKUP_ITEMS
|
|||||||
NM_BACKUP_ITEMS['nginx-settings']=${NM_NGINXPATH}
|
NM_BACKUP_ITEMS['nginx-settings']=${NM_NGINXPATH}
|
||||||
NM_BACKUP_ITEMS['nginx-logs']=/var/log/nginx
|
NM_BACKUP_ITEMS['nginx-logs']=/var/log/nginx
|
||||||
NM_BACKUP_ITEMS['letsencrypt-certs']=${NM_CERTPATH}
|
NM_BACKUP_ITEMS['letsencrypt-certs']=${NM_CERTPATH}
|
||||||
NM_BACKUP_ITEMS['webserver-files']=/var/www
|
NM_BACKUP_ITEMS['webserver-files']=${NM_WWWPATH}
|
||||||
NM_BACKUP_ITEMS['haproxy']=/etc/haproxy
|
NM_BACKUP_ITEMS['haproxy']=/etc/haproxy
|
||||||
NM_BACKUP_ITEMS['keepalived']=/etc/keepalived
|
NM_BACKUP_ITEMS['keepalived']=/etc/keepalived
|
||||||
NM_BACKUP_ITEMS['fail2ban']=/etc/fail2ban
|
NM_BACKUP_ITEMS['fail2ban']=/etc/fail2ban
|
||||||
|
NM_BACKUP_ITEMS['nmg-conf']=${NM_FOLDER}/conf
|
||||||
# NM_BACKUP_ITEMS[nginx]=/
|
# NM_BACKUP_ITEMS[nginx]=/
|
||||||
|
|
||||||
for NTYPE in "${NM_NODE_TYPES[@]}"; do
|
for NTYPE in "${NM_NODE_TYPES[@]}"; do
|
||||||
|
|||||||
@@ -30,14 +30,12 @@ BACKUP(){
|
|||||||
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
|
[ ! -d ${BACKUP_FOLDER} ] && mkdir -p ${BACKUP_FOLDER}
|
||||||
mkdir -p ${BACKUP_FOLDER}
|
|
||||||
fi
|
|
||||||
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 '${item}'${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' >/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]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Yellow]}Not found${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}Not found${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user