From d3386a2472aff813fa99c93446f95524c72cc5b8 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 7 Oct 2018 18:07:45 +0200 Subject: [PATCH] Section the split and backup methods to avoid confusion. Signed-off-by: DL6ER --- docs/ftldns/database.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/ftldns/database.md b/docs/ftldns/database.md index 3cbb214..2210646 100644 --- a/docs/ftldns/database.md +++ b/docs/ftldns/database.md @@ -4,6 +4,13 @@ We update the database file periodically and on exit of *FTL*DNS (triggered e.g. The location of the database can be configures by the config parameter [`DBFILE`](configfile.md#dbfile). It defaults to `/etc/pihole/pihole-FTL.db`. If the given file does not exist, *FTL*DNS will create a new (empty) database file. +Another way of controlling the size of the long-term database is setting a maximum age for log queries to keep using the config parameter [`MAXDBDAYS`](configfile.md#maxdbdays). It defaults to 365 days, i.e. queries that are older than one year get periodically removed to limit the growth of the long-term database file. + +The config parameter [`DBIMPORT`](configfile.md#dbimport) controls whether `FTL` loads information from the database on startup. It need to do this to populate the internal datastructure with the most recent history. However, as importing from the database on disk can delay FTL on very large deploys, it can be disabled using this option. + +--- +### Split database + You can split your long-term database by periodically rotating the database file (do this only when `pihole-FTL` is *not* running). The individual database contents can easily be merged when required. This could be implemented by running a monthly `cron` job such as: ``` @@ -13,15 +20,14 @@ sudo service pihole-FTL start ``` Note that DNS resolution will not be available as long as `pihole-FTL` is stopped. +### Backup database + The database can be backed up while FTL is running when using the SQLite3 Online backup method, e.g., ``` sqlite3 /etc/pihole/pihole-FTL.db ".backup /home/pi/pihole-FTL.db.backup" ``` will create `/home/pi/pihole-FTL.db.backup` which is a copy of your long-term database. -Another way of controlling the size of the long-term database is setting a maximum age for log queries to keep using the config parameter [`MAXDBDAYS`](configfile.md#maxdbdays). It defaults to 365 days, i.e. queries that are older than one year get periodically removed to limit the growth of the long-term database file. - -The config parameter [`DBIMPORT`](configfile.md#dbimport) controls whether `FTL` loads information from the database on startup. It need to do this to populate the internal datastructure with the most recent history. However, as importing from the database on disk can delay FTL on very large deploys, it can be disabled using this option. ---