Improve backup resiliency #15
Loading…
Reference in a new issue
No description provided.
Delete branch "multi-servers-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If the backup server is unreachable,
zzz_evobackup
falls back to the next in the list until one is available; otherwise it stops with an error.@ -24,0 +24,4 @@
SERVERS="node0.backup.example.com:2XXX node1.backup.example.com:2XXX"
# timeout (in seconds) for the SSH test
SSH_CONNECT_TIMEOUT=10
Maybe we can use a higher value. SSH connection can be really slow when the server I/O struggle.
60s?
Or 30s.
10s is a bit too low.
@ -34,0 +71,4 @@
fi
salt=$(hostname | cksum | cut -d' ' -f1)
item=$(( ($(date +%d) + salt + inc) % list_length ))
This part is not easy to understand quickly.
Could you add some comments for test_server and pick_server, to explain what the function do precisely.
Also maybe you could use an array for the server list?
@ -36,2 +81,2 @@
if [ -e $PIDFILE ]; then
pid=$(cat "$PIDFILE")
PIDFILE="/var/run/evobackup.pid"
if [ -e "${PIDFILE}" ]; then
Adding quotes and braces is not related to the PR.
I guess this is hard to refrain from "beautifying" the code. ;)
@ -66,3 +99,3 @@
## OpenLDAP : example with slapcat
# slapcat -l /home/backup/ldap.bak
# slapcat -l ${LOCAL_BACKUP_DIR}/ldap.bak
Adding variables is not related to backup resiliency. I guess this is hard to refrain from “beautifying” the code. ;)
@ -214,2 +266,4 @@
fi
# /!\ DO NOT USE COMMENTS in the rsync command /!\
# It breaks the command and destroys data, simply remove (or add) lines.
Not related to resiliency. This PR should really be split.
@benpro I've added comments, like you suggested. I've removed the LOCAL_BACKUP_DIR variable extraction.
LGTM. But some cosmetic change could be done in an other PR.
(spaces, braces, adding
"
, …)I've removed all "cosmetic changes"
LGTM. /cc @vlaborie
LGTM
LGTM