Add docs for rattail backup command

This commit is contained in:
Lance Edgar 2021-10-31 21:18:04 -05:00
parent 47fb1e451a
commit 25d1c1b739
10 changed files with 667 additions and 7 deletions

View file

@ -0,0 +1,63 @@
.. highlight:: ini
================
Database Dumps
================
Rattail can dump all of your databases to file so that they can be
included in the filesystem backup that happens via ``rsync`` and/or
``borg create``.
It only supports PostgreSQL and MySQL/MariaDB but those should work
out of the box. It will figure out which databases are present, then
dump each to its own file. Note that it puts them all in the
``/root/data`` folder by default.
Configuration
=============
You can enable the database dump feature like so::
[rattail.backup]
dbdump = true
Note that the dbdump feature is *enabled* by default; you can disable
like so::
[rattail.backup]
dbdump = false
If you don't like ``/root/data`` then you can change output folder::
[rattail.backup]
dbdump.output = /my/preferred/folder
Exclude certain databases which you do not need backed up (note, it
does not matter if these live in PostgreSQL or MySQL, Rattail will
just ignore these regardless where they're found)::
[rattail.backup]
dbdump.exclude = mytestdb, anotherdb
Alternate syntax for that, useful for longer lists::
[rattail.backup]
dbdump.exclude =
mytestdb
anotherdb
Or, *only* include certain databases and exclude all others::
[rattail.backup]
dbdump.include =
importantdb
anotherdb
If you want, Rattail can dump *all* tables individually as well as
dumping the databases themselves. Each database file will be
accompanied by a folder which will contain the table files::
[rattail.backup]
dbdump.dump_tables = true