2024-10-09 07:36:12 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# If the -q (quiet) flag is supplied, send all output to /dev/null.
|
|
|
|
if [[ "$1" == "-q" ]]; then
|
|
|
|
exec >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! kbackup --verbose --autobg /home/jas/documents/default.kbp; then
|
|
|
|
logger -t sync_to_remotes -s "Error running kbackup"
|
2024-10-15 00:07:17 +02:00
|
|
|
/usr/local/bin/resend_status.py sync_to_remotes err
|
2024-10-09 07:36:12 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-15 00:07:17 +02:00
|
|
|
if ! rclone sync --transfers 8 -P /home/jas/sync_to_remotes/ protondrive:/desktop-backups/ ; then
|
2024-10-09 07:36:12 +02:00
|
|
|
logger -t sync_to_remotes -s "Error running rclone for protondrive remote"
|
2024-10-15 00:07:17 +02:00
|
|
|
/usr/local/bin/resend_status.py sync_to_remotes err
|
2024-10-09 07:36:12 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-15 00:07:17 +02:00
|
|
|
if ! rclone sync --transfers 8 -P /home/jas/sync_to_remotes/ wasabi:/desktop-backups-rep/ ; then
|
2024-10-09 07:36:12 +02:00
|
|
|
logger -t sync_to_remotes -s "Error running rclone for wasabi remote"
|
2024-10-15 00:07:17 +02:00
|
|
|
/usr/local/bin/resend_status.py sync_to_remotes err
|
2024-10-09 07:36:12 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
logger -t sync_to_remotes "sync_to_remotes ran successfully"
|
2024-10-15 00:07:17 +02:00
|
|
|
/usr/local/bin/resend_status.py sync_to_remotes ok
|
2024-10-09 07:36:12 +02:00
|
|
|
|
|
|
|
exit 0
|