Skip to content

Instantly share code, notes, and snippets.

@dnno
Created May 10, 2021 11:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dnno/a87ee637debb45711e7843de716bf3ee to your computer and use it in GitHub Desktop.
Systemd Vaultwarden backup service
[Unit]
Description=backup the vaultwarden sqlite database and attachments
[Service]
Type=oneshot
WorkingDirectory=/media/backup
ExecStart=/usr/bin/env sh -c 'sqlite3 /home/pi/bw-data//db.sqlite3 ".backup backup-$(date -Is | tr : _).sq3"'
ExecStart=/usr/bin/env sh -c 'tar cvfz bw-attachments-$(date -Is | tr : _).tar.gz /home/pi/bw-data/attachments/'
ExecStart=/usr/bin/find . -type f -mtime +30 -name 'backup*' -delete
ExecStart=/usr/bin/find . -type f -mtime +30 -name 'bw-attachments*' -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment