diff --git a/shell.nix b/shell.nix index 69d363d..dd251d8 100644 --- a/shell.nix +++ b/shell.nix @@ -33,6 +33,7 @@ mkShell { python312Packages.isort python312Packages.pytest python312Packages.requests + python312Packages.resend python312Packages.rich pyright python-qbittorrent diff --git a/sync_remotes b/sync_remotes index 6c48e78..bd465f9 100755 --- a/sync_remotes +++ b/sync_remotes @@ -1,5 +1,8 @@ #!/usr/bin/env bash +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 @@ -7,22 +10,29 @@ fi if ! rsync -avz --delete root@hyperreal.coffee:/srv/borgbackup/hyperreal/ /mnt/borgbackup/hyperreal; then /home/jas/bin/resend_error.py "hyperreal-borg" logger -t sync_remotes "Error during sync of hyperreal-borg" -else - logger -t sync_remotes "hyperreal-borg successfully synced" fi +logger -t sync_remotes "hyperreal-borg successfully synced" + 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" logger -t sync_remotes "Error during sync of auxnc-96g-borg" -else - logger -t sync_remotes "auxnc-96g-borg successfully synced" fi +logger -t sync_remotes "auxnc-96g-borg successfully synced" + if ! rsync -avz --delete root@hyperreal.coffee:/home/mastodon/live/public/system/ /mnt/mastodata; then /home/jas/bin/resend_error.py "mastodata" logger -t sync_remotes "Error during sync of mastodata" -else - logger -t sync_remotes "mastodata successfully synced" fi +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 diff --git a/sync_to_protondrive b/sync_to_protondrive new file mode 100644 index 0000000..05f92a1 --- /dev/null +++ b/sync_to_protondrive @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if ! flatpak run org.kde.kbackup --auto /home/jas/shared/default.kbp; then + logger -t backup_home -s "Error running kbackup" + exit 1 +fi + +if ! /home/jas/.local/bin/rclone sync --transfers 8 /home/jas/sync-to-protondrive/ protondrive: ; then + logger -t backup_home -s "Error running rclone" + exit 1 +fi + +exit 0