admin-scripts/sync_to_remotes

26 lines
734 B
Plaintext
Raw Normal View History

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"
exit 1
fi
if ! rclone sync --transfers 8 -P /home/jas/sync_to_remotes/ protondrive:/desktop_backups/ ; then
logger -t sync_to_remotes -s "Error running rclone for protondrive remote"
exit 1
fi
if ! rclone sync --transfers 8 -P /home/jas/sync_to_remotes/ wasabi:/moonshadow-desktop/ ; then
logger -t sync_to_remotes -s "Error running rclone for wasabi remote"
exit 1
fi
logger -t sync_to_remotes "sync_to_remotes ran successfully"
exit 0