Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions backup.jps
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ 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:
- llsmp
- litespeedphp
- nginxphp-dockerized
- nginx-dockerized
- Node.js
- almalinux-vps
- ubuntu-vps
- lemp
- apache
- redis
- redis7
- redis6
Expand Down
8 changes: 8 additions & 0 deletions scripts/backup-logic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions scripts/mariadb-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down