Created
May 10, 2021 11:13
-
-
Save dnno/a87ee637debb45711e7843de716bf3ee to your computer and use it in GitHub Desktop.
Systemd Vaultwarden backup service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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