Update password backup scripts
This commit is contained in:
19
.bin/restore-passwddb
Executable file
19
.bin/restore-passwddb
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Backup existing password databases and
|
||||
# database keys (using date in filename date -u
|
||||
# +%Y-%m-%d_%H-%M-%S)
|
||||
|
||||
RCLONE_REMOTE="proton-drive"
|
||||
|
||||
for f in "$HOME/doc"/*.{kdbx,kdbx.key}; do
|
||||
[ -e "$f" ] || continue
|
||||
echo "Backing up $f to $f-$(date -u +%Y-%m-%d_%H-%M-%S)"
|
||||
cp "$f" "$f-$(date -u +%Y-%m-%d_%H-%M-%S)"
|
||||
done
|
||||
|
||||
echo "Restoring KeePassXC databases and database keys"
|
||||
rclone copyto \
|
||||
"$RCLONE_REMOTE:doc"/ "$HOME/doc/" \
|
||||
--progress \
|
||||
--include "/*.{kdbx,kdbx.key}"
|
||||
Reference in New Issue
Block a user