Write logging of 'pihole -g' and scheduled 'pihole updateGravity' in a logfile

Write the logging of 'pihole -g' and the scheduled 'pihole updateGravity' in a logfile. With a long blocklist (> 0,5 mil.) it takes a long period reading/checking the blocklist at the end of the updateGravity process. In the meantime Cron tried to connect the SMTP server for sending the mail. After the reading of the blocklist is completed you see in pihole -t log a lot of tries to get connected. In mailerr.log a connect problem is written. I think that the answer of the mailserver is missed by the Pi because the high CPU load. I have tried this with a local SMTP server and with Gmail SMTP. So, I didn't receive a mail for the Gravity action.

I have solved this by changing /etc/crond.d/pihole
59 1 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updateGravity >/var/log/updateGravity.log

I haven't changed pihole.sh but this can be done in the same method for pihole -g process
Bij using a > the updateGravity.log is overwritten each time, so only the latest is shown in /var/log/.

I also have scheduled a task for mailing the info in this file.

I use a PI3, a high speed 32 GB SD card and the ssmtp, mailutils and mpack packages for mail.

3 posts were merged into an existing topic: General logging of the system

A post was merged into an existing topic: General logging of the system