Backup1
Backup
La sicurezza delle password è cruciale, ma altrettanto importante è la capacità di recuperare i dati in caso di necessità. Ecco come impostare un efficace sistema di backup per Vaultwarden:
- Pianificazione regolare: Stabilisci una frequenza regolare per eseguire i backup, ad esempio settimanalmente o mensilmente.
- Metodi di backup: Scegli tra diverse opzioni di backup, come backup su cloud o su un dispositivo di archiviazione locale.
- Procedura di ripristino: Assicurati di comprendere il processo di ripristino e verifica periodicamente che tutto funzioni correttamente.
GitLab Repo for vaultwarden backup container In this case, I am using manual backup.
Backup command
It is not possible to use ~ in the command because it is execute by sudo and for the root user the home folder is /root.
docker run --rm --volumes-from=VaultWarden -e UID=1000 -e BACKUP_DIR=/data/backup -e TIMESTAMP=true -e DELETE_AFTER=365 -v /home/pi/vaultwardenbackup/backup:/data/backup bruceforce/vaultwarden-backup:latest manual
script
#script.sh SCRIPT RICHIAMATO DA CRONTAB TUTTE LE SERE ALLE 7:07PM
docker run --rm --volumes-from=VaultWarden -e UID=1000 -e BACKUP_DIR=/data/backup -e TIMESTAMP=true -e DELETE_AFTER=365 -v /home/pi/vaultwardenbackup/backup:/data/backup bruceforce/vaultwarden-backup:latest manual
Folders organization
I created a symbolic link in /home/pi/ called vaultwardenbackup pointing at /home/pi/syncthing/sync/vaultwarden/ where the backups and the script are.
ln -s /home/pi/syncthing/sync/valutwarden /home/pi/vaultwardenbackup
Crontab line
sudo crontab -e
00 19 * * * bash /home/pi/vaultwardenbackup/script.sh > /home/pi/vaultwardenbackup/output.log 2>&1