Moving long-term stats database /etc/pihole/pihole-FTL.db to /var/log - SQL error

Hi, I'm trying to make my pihole write its long-term stats database to /var/log/pihole-FTL.db instead of /etc/pihole/pihole-FTL.db to reduce the writes on the sd card. /var/log is mounted as ramdisk (tmpfs) in fstab and all other log files are working fine with that configuration.

What I did to achive this:

ln -s /var/log/pihole-FTL.db /etc/pihole/pihole-FTL.db

and also append the following lines to /etc/rc.local to get executed on each boot:

touch /var/log/pihole-FTL.db
chmod 644 /var/log/pihole-FTL.db
chown pihole:pihole /var/log/pihole-FTL.db

The results of "ls -l /etc/pihole/pihole-FTL.db /var/log/pihole-FTL.db" are

lrwxrwxrwx 1 root root 22 May 20 14:51 /etc/pihole/pihole-FTL.db -> /var/log/pihole-FTL.db
-rw-r--r-- 1 pihole pihole  0 May 20 14:55 /var/log/pihole-FTL.db

But the database file stays empty and the log at /var/log/pihole-FTL.log just says

[...]
Database initialized
read_data_from_DB() - SQL error prepare (1): no such table: queries
[...]

I also tried to create /etc/pihole/pihole-FTL.conf with

DBFILE=/var/log/pihole-FTL.db

but the error in the log stays the same.

Is there any quick way to fix this?

Note: Please don't spend too much time on this, since it's a low priority for me and I'm fine with having the long-term stats disabled.

After changing DBFILE did you delete the database file and restart FTL?

Yes, I did a full reboot. Could it be that the database is somehow "premade" and must not be an empty file?

ln -s takes in the original file and then the link name after, so you may have switched around the parameters.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.