How to trigger a manual write to pihole-FTL.db

I have my DBINTERVAL set to 300. What command can I run to trigger a manual write to the database?

sudo service pihole-FTL restart will do it

https://docs.pi-hole.net/ftldns/database/

Thanks for the reply. It seems that the manual write out does not occur when the service is stopped does it?

I don't know. From the referenced documentation it appears that the write occurs when FTL stops. If FTL is not running, nothing is writing to this database.

You could certainly test it - stop FTL and see what the database date/time is after that.

Just curious why the DBINTERVAL of 300 minutes. What led you to that number?

Yes, the write out does not happen when it's stopped. I think that is a bug. If the user has a longer interval and shutsdown the machine the data are lost. As part of the shutdown process, the service should write out the most recent data I think. What do you think?

I am using an SD card for my filesystem and I want to minimize writes to it. I have already gone through one card (bad sectors) due to wear so the longer interval makes sense.

I'll defer to one of the developers on this.

300 is a very long DBINTERVAL, so you assume some risk of having a system crash and losing all that data regardless of how FTL behaves.

I would recommend something closer to 5.0 or 10.0.

If you want to minimize writes to the SD card, you can disable query logging, which will keep Pi-Hole from writing to file /var/log/pihole.log. With FTL having access to the dnsmasq data, this file is no longer required. I have this logging disabled on one of my Pi-Holes and there is no noticeable difference in displayed data.

Admin GUI (settings > system > disable query logging).

One of the devs has looked at this and sees the same behavior. He has flagged it for followup.

Thanks for pointing out this bug. Feedback from users is very helpful.

1 Like