My pihole log file keeps getting rotated twice a day at weird times.
-rw-r----- 1 pihole pihole 1.0M Oct 3 00:00 /var/log/pihole/pihole.log.14.gz
-rw-r----- 1 pihole pihole 36K Oct 3 00:48 /var/log/pihole/pihole.log.13.gz
-rw-r----- 1 pihole pihole 925K Oct 4 00:00 /var/log/pihole/pihole.log.12.gz
-rw-r----- 1 pihole pihole 12K Oct 4 00:16 /var/log/pihole/pihole.log.11.gz
-rw-r----- 1 pihole pihole 814K Oct 5 00:00 /var/log/pihole/pihole.log.10.gz
-rw-r----- 1 pihole pihole 37K Oct 5 00:56 /var/log/pihole/pihole.log.9.gz
-rw-r----- 1 pihole pihole 957K Oct 6 00:00 /var/log/pihole/pihole.log.8.gz
-rw-r----- 1 pihole pihole 27K Oct 6 00:45 /var/log/pihole/pihole.log.7.gz
-rw-r----- 1 pihole pihole 1023K Oct 7 00:00 /var/log/pihole/pihole.log.6.gz
-rw-r----- 1 pihole pihole 20K Oct 7 00:15 /var/log/pihole/pihole.log.5.gz
-rw-r----- 1 pihole pihole 1.1M Oct 8 00:00 /var/log/pihole/pihole.log.4.gz
-rw-r----- 1 pihole pihole 31K Oct 8 00:40 /var/log/pihole/pihole.log.3.gz
-rw-r----- 1 pihole pihole 842K Oct 9 00:00 /var/log/pihole/pihole.log.2.gz
-rw-r----- 1 pihole pihole 249K Oct 9 00:17 /var/log/pihole/pihole.log.1
-rw-r----- 1 pihole pihole 11M Oct 9 21:59 /var/log/pihole/pihole.log
The reason that I noticed this is because my Pi was set to reboot daily or every second day at 23:55 (to resolve this https://discourse.pi-hole.net/t/what-is-the-effect-of-rtr-advert-eth0-ipv6-prefix-old-prefix/). I stopped this after seeing the log rotation times (on the 6th).
Because of the reboots, I changed rotate 5 to rotate 14 in the pihole.log section of /etc/logrotate.d/pihole.
As you can see, the rotations are not due to reboots.
Oct 03 12:32:14 dns-server systemd-logind[336]: The system will reboot now!
Oct 03 23:55:01 dns-server systemd-logind[335]: The system will reboot now!
Oct 04 16:34:45 dns-server systemd-logind[338]: The system will reboot now!
Oct 04 23:55:01 dns-server systemd-logind[334]: The system will reboot now!
Oct 05 20:09:11 dns-server systemd-logind[336]: The system will reboot now!
Oct 05 23:55:01 dns-server systemd-logind[335]: The system will reboot now!
The timestamps of the first and last entries in each log file:
/var/log/pihole/pihole.log.14.gz
Oct 2 00:32:54
Oct 3 00:00:01
/var/log/pihole/pihole.log.13.gz
Oct 3 00:00:05
Oct 3 00:48:33
/var/log/pihole/pihole.log.12.gz
Oct 3 00:48:33
Oct 4 00:00:00
/var/log/pihole/pihole.log.11.gz
Oct 4 00:00:04
Oct 4 00:16:13
/var/log/pihole/pihole.log.10.gz
Oct 4 00:16:16
Oct 5 00:00:00
/var/log/pihole/pihole.log.9.gz
Oct 5 00:00:01
Oct 5 00:56:58
/var/log/pihole/pihole.log.8.gz
Oct 5 00:57:11
Oct 6 00:00:00
/var/log/pihole/pihole.log.7.gz
Oct 6 00:00:03
Oct 6 00:45:31
/var/log/pihole/pihole.log.6.gz
Oct 6 00:45:52
Oct 7 00:00:01
/var/log/pihole/pihole.log.5.gz
Oct 7 00:00:02
Oct 7 00:15:19
/var/log/pihole/pihole.log.4.gz
Oct 7 00:15:24
Oct 8 00:00:01
/var/log/pihole/pihole.log.3.gz
Oct 8 00:00:01
Oct 8 00:40:58
/var/log/pihole/pihole.log.2.gz
Oct 8 00:41:03
Oct 9 00:00:00
/var/log/pihole/pihole.log.1
Oct 9 00:00:03
Oct 9 00:17:20
/var/log/pihole/pihole.log
Oct 9 00:17:43
Oct 9 22:36:15
Can anyone tell why my pihole log file is being rotated at midnight (correct) and then again at 00:15, 00:16, 00:17, 00:40, 00:45, 00:48, 00:50 or 00:56?