From 02ad1b90134f0368368350850cdc3e5037a2a03b Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 3 Jul 2024 17:23:16 +0200 Subject: [PATCH 1/5] Update backup.jps I added cp, lemp and apache nodetyes because they also have databases that need to be backupped --- backup.jps | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backup.jps b/backup.jps index 530389e..fd1da31 100644 --- a/backup.jps +++ b/backup.jps @@ -6,10 +6,13 @@ targetEditions: any logo: /images/backup-logo.png description: Backup Add-On for the database. It can be used to create scheduled backups according to any required timezone and restore corrupted databases, even if the content has been completely deleted. -baseUrl: https://raw.githubusercontent.com/jelastic-jps/database-backup-addon/master +baseUrl: https://raw.githubusercontent.com/shaundma/database-backup-addon/master targetNodes: - nodeType: + nodeType: + - cp + - lemp + - apache - redis - redis7 - redis6 From b1bdedc20f6a7f853e657b0735a8cf71131deab0 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 3 Jul 2024 18:22:53 +0200 Subject: [PATCH 2/5] Update backup-logic.sh Added an additional check for port 3306 on 127.0.0.1 If detected then SERVER_IP_ADDR="localhost" --- scripts/backup-logic.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/backup-logic.sh b/scripts/backup-logic.sh index 9cdc33b..4a52eca 100644 --- a/scripts/backup-logic.sh +++ b/scripts/backup-logic.sh @@ -151,6 +151,14 @@ function backup(){ else SERVER_IP_ADDR=$(ip a | grep -A1 venet0 | grep inet | awk '{print $2}'| sed 's/\/[0-9]*//g' | tail -n 1) [ -n "${SERVER_IP_ADDR}" ] || SERVER_IP_ADDR="localhost" + # additional check for port 3306 on 127.0.0.1 + ns_output=$(netstat -tnlp | grep ':3306' | awk '{print $4}' | cut -d: -f1) + for ip in $ns_output; do + if [ "$ip" == "127.0.0.1" ]; then + SERVER_IP_ADDR="localhost" + fi + done + # end additional check if which mariadb 2>/dev/null; then CLIENT_APP="mariadb" else From 536d04fe40f96b47219bcedd96747e388651394e Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 3 Jul 2024 19:02:06 +0200 Subject: [PATCH 3/5] Update backup.jps Added nodetype llsmp --- backup.jps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.jps b/backup.jps index fd1da31..01fca58 100644 --- a/backup.jps +++ b/backup.jps @@ -10,7 +10,7 @@ baseUrl: https://raw.githubusercontent.com/shaundma/database-backup-addon/master targetNodes: nodeType: - - cp + - llsmp - lemp - apache - redis From 5147c6674b44f869abab30d23ab5015f19b33b16 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 3 Jul 2024 19:12:28 +0200 Subject: [PATCH 4/5] Update backup.jps Added - litespeedphp - nginxphp-dockerized - nginx-dockerized - Node.js - almalinux-vps - ubuntu-vps --- backup.jps | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backup.jps b/backup.jps index 01fca58..537faf6 100644 --- a/backup.jps +++ b/backup.jps @@ -11,6 +11,12 @@ baseUrl: https://raw.githubusercontent.com/shaundma/database-backup-addon/master targetNodes: nodeType: - llsmp + - litespeedphp + - nginxphp-dockerized + - nginx-dockerized + - Node.js + - almalinux-vps + - ubuntu-vps - lemp - apache - redis From d112db57f4887c94a487a70a472fd595cbfb8333 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 3 Jul 2024 19:52:10 +0200 Subject: [PATCH 5/5] Update mariadb-restore.sh # additional check for port 3306 on 127.0.0.1 --- scripts/mariadb-restore.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/mariadb-restore.sh b/scripts/mariadb-restore.sh index 2bc18b1..22c2229 100644 --- a/scripts/mariadb-restore.sh +++ b/scripts/mariadb-restore.sh @@ -2,6 +2,14 @@ SERVER_IP_ADDR=$(ip a | grep -A1 venet0 | grep inet | awk '{print $2}'| sed 's/\/[0-9]*//g' | tail -n 1) [ -n "${SERVER_IP_ADDR}" ] || SERVER_IP_ADDR="localhost" +# additional check for port 3306 on 127.0.0.1 +ns_output=$(netstat -tnlp | grep ':3306' | awk '{print $4}' | cut -d: -f1) +for ip in $ns_output; do + if [ "$ip" == "127.0.0.1" ]; then + SERVER_IP_ADDR="localhost" + fi +done +# end additional check if which mariadb 2>/dev/null; then CLIENT_APP="mariadb" else