diff --git a/.bin/save-passwddb b/.bin/save-passwddb index 8a5ff3e..bf705fb 100755 --- a/.bin/save-passwddb +++ b/.bin/save-passwddb @@ -8,14 +8,17 @@ # `systemctl --user enable save-passwddb.service` # `systemctl --user enable save-passwddb.timer` -# https://unix.stackexchange.com/questions/100871/in-a-bash-if-condition-how-to-check-whether-any-files-matching-a-simple-wildcard +RCLONE_REMOTE="proton-drive" + +# Reference: if [ 0 -lt "$(ls $HOME/doc/*.kdbx 2>/dev/null | wc -w)" ]; then - rclone copy "$HOME/doc" google-drive:doc --include "*.kdbx" - rclone copy "$HOME/doc" google-drive:doc --include "*.kdbx.key" + echo "Saving KeePassXC databases and database keys" + rclone copyto \ + "$HOME/doc/" proton-drive:doc/ \ + --include "/*.{kdbx,kdbx.key}" else echo "No password database found, use the following commands to restore" echo "" - echo "rclone copy google-drive:doc \"$HOME/doc\" --include \"*.kdbx\"" - echo "rclone copy google-drive:doc \"$HOME/doc\" --include \"*.kdbx.key\"" + echo "rclone copy $RCLONE_REMOTE:doc \"$HOME/doc\" --include \"*.{kdbx,kdbx.key}\"" exit 1 fi