mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-01 16:03:06 +01:00
Add verbosity and quiet switch
This commit is contained in:
parent
45ffe3579b
commit
152bed933d
15
sync_to_protondrive
Normal file → Executable file
15
sync_to_protondrive
Normal file → Executable file
@ -1,13 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if ! kbackup --auto /home/jas/documents/default.kbp; then
|
# If the -q (quiet) flag is supplied, send all output to /dev/null.
|
||||||
logger -t backup_home -s "Error running kbackup"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! rclone sync --transfers 8 /home/jas/sync_to_protondrive/ protondrive: ; then
|
if ! rclone sync --transfers 8 -P /home/jas/sync_to_protondrive/ protondrive: ; then
|
||||||
logger -t backup_home -s "Error running rclone"
|
logger -t sync_to_protondrive -s "Error running rclone"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
logger -t sync_to_protondrive "sync_to_protondrive ran successfully"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user