Skip to content

Commit

Permalink
Merge pull request Uberspace#1568 from ppac/patch-1
Browse files Browse the repository at this point in the history
Update guide_vaultwarden.rst
  • Loading branch information
kimdiallo authored Oct 11, 2023
2 parents 4e10163 + 2dc70c4 commit f310919
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions source/guide_vaultwarden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,24 @@ You can create a backup of the database manually. ``cd`` to your project folder,

.. code-block:: console
[isabell@stardust ~]$ mkdir ~/vaultwarden/output/data/db-backup
[isabell@stardust ~]$ sqlite3 ~/vaultwarden/output/data/db.sqlite3 ".backup '$HOME/vaultwarden/output/data/db-backup/backup.sqlite3'"
[isabell@stardust ~]$ mkdir ~/vaultwarden/data/db-backup
[isabell@stardust ~]$ sqlite3 ~/vaultwarden/data/db.sqlite3 ".backup '$HOME/vaultwarden/data/db-backup/backup.sqlite3'"
.. note :: You could run this command through a CRON job everyday - note that it will overwrite the same backup.sqlite3 file each time. If you want to save every version of the backup, please read further.
Alternatively, you can do the backup with a timestamp and it can be useful if you don't want that the CRON job overwrites the backup file. ``$(date +%Y-%m-%d)`` in the file name in the following command will generate a name with current year, month and day.

.. code-block:: console
[isabell@stardust ~]$ sqlite3 ~/vaultwarden/output/data/db.sqlite3 ".backup '$HOME/vaultwarden/output/data/db-backup/$(date +%Y-%m-%d).sqlite3'"
[isabell@stardust ~]$ sqlite3 ~/vaultwarden/data/db.sqlite3 ".backup '$HOME/vaultwarden/data/db-backup/$(date +%Y-%m-%d).sqlite3'"
To do this, create a bash script with the last command and save it as ``~/backup-vaultwarden.sh`` and make it executable.

.. code-block:: console
[isabell@stardust ~]$ chmod +x backup-vaultwarden.sh
Now you can add this script into your crontab.

Restore up your vault manually
------------------------------
Expand Down

0 comments on commit f310919

Please sign in to comment.