Delete log's after this pihole don't work any more

Hi,
When you delete the logs in cli like this
find .. -type f -name ".log" -delete
find .. -type f -name ".
.log" -delete
find .. -type f -name "..log.old" -delete
find .. -type f -name "
.log.*" -delete

After that pihole don't work any more because he can't write to the log files any more because he don't find any more.

for solution i have this
pihole -f

Is there a possibility that the devs can make that if no files found , pihole auto create them again?

Thank you

Have you tried to restart pihole after you deleted the files manually?

pihole restartdns

Wild guess here but if it's only checking existence of the file, You could recreate an empty file with 'touch '?

The log files are port of logrotate. If you manually delete them, Pi-hole might still expects them to be there to log stuff there.

Touch -> Try it :slight_smile:
P.S. Why did you delete the logs at all?

1 Like

When you want to flush your logs, just use

pihole flush

It's the same

Debugging Options:
  -f, flush           Flush the Pi-hole log

Why does OP even ask then if he has the solution?
"Surprise my system doesn't work anymore if I delete some files that are expected to be there."

Don't delete them in the first place!

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