This commit is contained in:
2023-05-13 23:07:10 -05:00
parent 32e469fe5e
commit 55d529b078
2 changed files with 14 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='4.6.40-05132023' VERS='4.6.45-05132023'
# NODETYPES=LB # NODETYPES=LB
NODETYPES=MYSQL,LB,WEB,NC,WPD,LPD,MM,PW NODETYPES=MYSQL,LB,WEB,NC,WPD,LPD,MM,PW
@@ -204,10 +204,15 @@ REPL_DESC['nextcloud-php']='Nextcloud PHP Settings'
declare -A BACKUP_ITEMS declare -A BACKUP_ITEMS
BACKUP_ITEMS[nginx-settings]=/etc/nginx BACKUP_ITEMS[nginx-settings]=/etc/nginx
BACKUP_ITEMS[letsencrypt-certs]=/etc/letsencrypt
BACKUP_ITEMS[gitea]=/var/lib/gitea
BACKUP_ITEMS[nginx-logs]=/var/logs/nginx BACKUP_ITEMS[nginx-logs]=/var/logs/nginx
#BACKUP_ITEMS[webserver-files]=/var/www BACKUP_ITEMS[letsencrypt-certs]=/etc/letsencrypt
BACKUP_ITEMS[webserver-files]=/var/www
BACKUP_ITEMS[haproxy]=/etc/haproxy
BACKUP_ITEMS[keepalived]=/etc/keepalived
BACKUP_ITEMS[fail2ban]=/etc/fail2ban
# BACKUP_ITEMS[nginx]=/
GET-CHECKCERT-DOMAINS(){ GET-CHECKCERT-DOMAINS(){
declare -A CHECKCERT_DOMAINS declare -A CHECKCERT_DOMAINS

View File

@@ -113,16 +113,13 @@ BACKUP(){
mkdir -p ${BACKUP_FOLDER} mkdir -p ${BACKUP_FOLDER}
fi fi
for item in "${!BACKUP_ITEMS[@]}"; do for item in "${!BACKUP_ITEMS[@]}"; do
c=0; cw=14; spc=''; spc1=${cw}-${#BACKUP_ITEMS[$item]}; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "Backing up '${item}'${spc}"
if [ -d ${BACKUP_ITEMS[$item]} ]; then if [ -d ${BACKUP_ITEMS[$item]} ]; then
# [ "${action}" != "backup" ] &&
echo -en "Backing up '${item}'... "
#tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} .
tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} . --exclude='./data/repository' --exclude='*/.stfolder' --exclude='*/.stversions' --exclude='*/.git' >/dev/null 2>&1 tar -czPf ${BACKUP_FOLDER}/${item}.tar.gz -C ${BACKUP_ITEMS[$item]} . --exclude='./data/repository' --exclude='*/.stfolder' --exclude='*/.stversions' --exclude='*/.git' >/dev/null 2>&1
# [ "${action}" != "backup" ] && echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo -e "${idsCL[Green]}Ok${idsCL[Default]}"
else else
# [ "${action}" != "backup" ] && echo -e "${idsCL[Yellow]}Not found${idsCL[Default]}"
echo -e "Not backing up '${item}', not found."
fi fi
done done
touch ${FOLDER}/backup.lastrun touch ${FOLDER}/backup.lastrun
@@ -1307,7 +1304,7 @@ GUI(){
echo -e "Commands followed by '-h' will show addtional info. {work-in-progress}" echo -e "Commands followed by '-h' will show addtional info. {work-in-progress}"
echo echo
echo -e "Usage: ${idsCL[LightCyan]}nodemgmt ${idsCL[Yellow]}{COMMAND}${idsCL[Default]} {" echo -e "Usage: ${idsCL[LightCyan]}nodemgmt ${idsCL[Yellow]}{COMMAND}${idsCL[Default]} {"
echo -e " ${idsCL[Yellow]}backup${idsCL[Default]} - Run backup" echo -e " ${idsCL[Yellow]}backup${idsCL[Default]} - Run backup of node items"
echo -e " ${idsCL[Yellow]}certrenew${idsCL[Default]} - Renew all SSL Certificates" echo -e " ${idsCL[Yellow]}certrenew${idsCL[Default]} - Renew all SSL Certificates"
echo -e " ${idsCL[Yellow]}checkcerts${idsCL[Default]} - Check SSL Expirations" echo -e " ${idsCL[Yellow]}checkcerts${idsCL[Default]} - Check SSL Expirations"
echo -e " ${idsCL[Yellow]}delsite${idsCL[Default]} - Delete entire site" echo -e " ${idsCL[Yellow]}delsite${idsCL[Default]} - Delete entire site"