Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:f64b634dd8
This commit is contained in:
19
dots/.bin/restore-passwddb
Executable file
19
dots/.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