diff --git a/.bin/save-passwddb b/.bin/save-passwddb new file mode 100755 index 0000000..c5b4386 --- /dev/null +++ b/.bin/save-passwddb @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Save (encrypted) password database to cloud storage +# +# Can be run manually or daily by enabling the corresponding systemd user +# service and timer, i.e. +# +# `systemctl --user enable save-passwddb.service` +# `systemctl --user enable save-passwddb.timer` + +rclone copy "$HOME/doc/passwd.kdbx" google-drive: diff --git a/.config/systemd/user/save-passwddb.service b/.config/systemd/user/save-passwddb.service new file mode 100644 index 0000000..c65d2a9 --- /dev/null +++ b/.config/systemd/user/save-passwddb.service @@ -0,0 +1,11 @@ +[Unit] +Description=Save KeypassXC password database to cloud +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +ExecStart=/home/h/.bin/save-passwddb + +[Install] +WantedBy=multi-user.target diff --git a/.config/systemd/user/save-passwddb.timer b/.config/systemd/user/save-passwddb.timer new file mode 100644 index 0000000..7a06535 --- /dev/null +++ b/.config/systemd/user/save-passwddb.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Save Keepass password database to cloud daily + +[Timer] +OnCalendar=daily +RandomizedDelaySec=12h +Persistent=true + +[Install] +WantedBy=timers.target