The issue I am facing:
It seems I have a high traffic home network, so the pihole.log
gets several Gb in size during one day. I want to decrease the log size by running log rotate hourly for the pihole.log
file instead of daily. I modified the file /etc/pihole/logrotate
and changed daily
to hourly
. Is it enough? Or I should do some other modifications?
I also have a doubt that the logrotate
runs at all for the Pi-hole files after I installed and enabled the log2ram
, because I don’t see any new compressed rotated log files after that date for pihole.log
. And my pihole.log
file gets bigger and bigger until it consumes all my free space and I have to flush it manually. Is there any way to check the logs or status of running the logrotate
job for the Pi-hole files?
**Details about my system: **
Debian 13 Trixie in LXC container, standard Pi-hole installation.
cat /etc/pihole/versions
CORE_VERSION=v6.1.4
CORE_BRANCH=master
CORE_HASH=cef7fd4b
GITHUB_CORE_VERSION=v6.1.4
GITHUB_CORE_HASH=cef7fd4b
WEB_VERSION=v6.2.1
WEB_BRANCH=master
WEB_HASH=cc1cc285
GITHUB_WEB_VERSION=v6.2.1
GITHUB_WEB_HASH=c0a237a6
FTL_VERSION=v6.2.3
FTL_BRANCH=master
FTL_HASH=88737f62
GITHUB_FTL_VERSION=v6.2.3
GITHUB_FTL_HASH=bc185680
cat /etc/pihole/logrotate
/var/log/pihole/pihole.log {
su root root
hourly
copytruncate
rotate 25
compress
delaycompress
notifempty
nomail
}
/var/log/pihole/FTL.log {
su root root
weekly
copytruncate
rotate 3
compress
delaycompress
notifempty
nomail
}
/var/log/pihole/webserver.log {
su root root
weekly
copytruncate
rotate 3
compress
delaycompress
notifempty
nomail
}
ls -lsh /var/log/pihole/
total 640K
8.0K -rw-r----- 1 pihole pihole 5.0K Sep 5 08:49 FTL.log
4.0K -rw-r----- 1 pihole pihole 2 Sep 5 08:29 FTL.log.1
4.0K -rw-r----- 1 pihole pihole 1.9K Sep 3 03:00 FTL.log.2.gz
4.0K -rw-r----- 1 pihole pihole 1.8K Sep 2 03:00 FTL.log.3.gz
196K -rw-r----- 1 pihole pihole 196K Sep 5 08:52 pihole.log
400K -rw-r----- 1 pihole pihole 398K Aug 28 03:00 pihole.log.6.gz
8.0K -rw-r----- 1 pihole pihole 4.2K Aug 31 07:17 pihole_updateGravity.log
4.0K -rw-r----- 1 pihole pihole 102 Sep 5 08:29 webserver.log
4.0K -rw-r----- 1 pihole pihole 2 Sep 5 08:29 webserver.log.1
4.0K -rw-r----- 1 pihole pihole 221 Aug 31 03:00 webserver.log.2.gz
4.0K -rw-r----- 1 pihole pihole 111 Aug 29 09:44 webserver.log.3.gz
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 8.8G 6.4G 2.0G 77% /
none 492K 4.0K 488K 1% /dev
devtmpfs 4.0M 0 4.0M 0% /dev/tty
tmpfs 47G 2.1M 47G 1% /dev/shm
tmpfs 19G 120K 19G 1% /run
tmpfs 47G 0 47G 0% /tmp
tmpfs 5.0M 0 5.0M 0% /run/lock
log2ram 5.0G 44M 5.0G 1% /var/log
tmpfs 9.4G 8.0K 9.4G 1% /run/user/0
top
top - 08:55:57 up 44 min, 1 user, load average: 0.00, 0.00, 0.13
Tasks: 26 total, 1 running, 25 sleeping, 0 stopped, 0 zombie
%Cpu(s): 10.0 us, 0.0 sy, 0.0 ni, 90.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 6144.0 total, 5177.7 free, 88.5 used, 923.0 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 6055.5 avail Mem
What I have changed since installing Pi-hole:
I installed log2ram
changed from the default configuration to use 5 Gb RAM for the logs to optimize the SSD writing and wear.