diff --git a/sync_to_protondrive b/sync_to_protondrive old mode 100644 new mode 100755 index 7c13fa2..d622758 --- a/sync_to_protondrive +++ b/sync_to_protondrive @@ -1,13 +1,20 @@ #!/usr/bin/env bash -if ! kbackup --auto /home/jas/documents/default.kbp; then - logger -t backup_home -s "Error running kbackup" +# 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_protondrive -s "Error running kbackup" exit 1 fi -if ! rclone sync --transfers 8 /home/jas/sync_to_protondrive/ protondrive: ; then - logger -t backup_home -s "Error running rclone" +if ! rclone sync --transfers 8 -P /home/jas/sync_to_protondrive/ protondrive: ; then + logger -t sync_to_protondrive -s "Error running rclone" exit 1 fi +logger -t sync_to_protondrive "sync_to_protondrive ran successfully" + exit 0