From 968e0cf13709ad4fadb1fcd1d18d73d55e3fd096 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 28 Sep 2018 12:11:43 +0200 Subject: [PATCH 1/3] Add backup instructions for long-term database. As we utilize the online backup functionality of SQLite3, a backup can be generated without having to stop/restart pihole-FTL, i.e., without interruption of DNS service. Signed-off-by: DL6ER --- docs/ftldns/database.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/ftldns/database.md b/docs/ftldns/database.md index 4c21efe..3cbb214 100644 --- a/docs/ftldns/database.md +++ b/docs/ftldns/database.md @@ -13,6 +13,12 @@ sudo service pihole-FTL start ``` Note that DNS resolution will not be available as long as `pihole-FTL` is stopped. +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. From d3386a2472aff813fa99c93446f95524c72cc5b8 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 7 Oct 2018 18:07:45 +0200 Subject: [PATCH 2/3] 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. --- From 2a88ac016b18e1e36bae875e2a491f43aef37c85 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 7 Oct 2018 18:10:34 +0200 Subject: [PATCH 3/3] Remove "for v4.0+" part in the header as this is now the regular version of Pi-hole. Signed-off-by: DL6ER --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 445d1f7..b684295 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: "Pi-hole documentation for v4.0+" +site_name: "Pi-hole documentation" site_url: https://docs.pi-hole.net repo_url: "https://github.com/pi-hole/pi-hole/" edit_uri: ""