admin-scripts/sync_remotes

39 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2024-10-02 05:29:17 +02:00
set -euo pipefail
# If the -q (quiet) flag is supplied, send all output to /dev/null.
if [[ "$1" == "-q" ]]; then
exec >/dev/null 2>&1
fi
2024-09-28 00:54:14 +02:00
if ! rsync -avz --delete root@hyperreal.coffee:/srv/borgbackup/hyperreal/ /mnt/borgbackup/hyperreal; then
/home/jas/bin/resend_error.py "hyperreal-borg"
2024-09-28 00:54:14 +02:00
logger -t sync_remotes "Error during sync of hyperreal-borg"
fi
2024-10-02 05:29:17 +02:00
logger -t sync_remotes "hyperreal-borg successfully synced"
2024-09-28 00:54:14 +02:00
if ! rsync -avz --delete root@auxnc-96g:/srv/backup/auxnc-96g/ /mnt/borgbackup/auxnc-96g; then
/home/jas/bin/resend_error.py "auxnc-96g-borg"
2024-09-28 00:54:14 +02:00
logger -t sync_remotes "Error during sync of auxnc-96g-borg"
fi
2024-10-02 05:29:17 +02:00
logger -t sync_remotes "auxnc-96g-borg successfully synced"
2024-09-28 00:54:14 +02:00
if ! rsync -avz --delete root@hyperreal.coffee:/home/mastodon/live/public/system/ /mnt/mastodata; then
/home/jas/bin/resend_error.py "mastodata"
2024-09-28 00:54:14 +02:00
logger -t sync_remotes "Error during sync of mastodata"
fi
2024-10-02 05:29:17 +02:00
logger -t sync_remotes "mastodata successfully synced"
if ! rsync -avz --delete root@desktop:/home/jas/sync-to-protondrive/ /mnt/desktop-data; then
/home/jas/bin/resend_error.py "desktop-data"
logger -t sync_remotes "Error during sync of desktop-data"
fi
logger -t sync_remotes "desktop-data successfully synced"
exit 0