bundles/backup-{client,server}: use node names, only deploy users to correct backup server
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This commit is contained in:
Franzi 2022-01-04 17:14:55 +01:00
parent 05aa78c254
commit 3e0269ba99
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 20 additions and 11 deletions

View file

@ -2,7 +2,9 @@
statusfile=/var/tmp/backup.monitoring
ssh_login="${username}@${server}"
ssh_cmnd="ssh -o IdentityFile=/etc/backup.priv -o StrictHostKeyChecking=accept-new -p ${port}"
<%text>
NL=$'\n'
if ! [[ -f /etc/backup.priv ]]
@ -32,7 +34,7 @@ do_backup() {
# Compress level 1 is a good compromise between speed and cpu usage.
rsync --compress-level=1 -aAP --numeric-ids --delete --relative \
--rsync-path="/usr/bin/rsync --fake-super" \
-e "ssh -o IdentityFile=/etc/backup.priv -o StrictHostKeyChecking=accept-new -p ${port}" \
-e "$ssh_cmnd" \
"$1" "$ssh_login":backups/
# Exit code 24 means some files have vanished during rsync.
@ -52,13 +54,13 @@ do_backup() {
if [[ "$backup_has_successfully_run" != "yes" ]]
then
echo "Backup for '$1' did not succeed!" | logger -t backup-client -p user.error
<%text>
rsync_errors+="${NL}${1}${rsync_errorcodes_for_this_path}"
</%text>
fi
}
rsync_errors=""
</%text>
% for path in sorted(paths):
do_backup "${path}"
% endfor