My DNS server's logs are the text files that growing too fast and one of them is already over 30 MB in size. I didn't set up the max. file sizes. I would prefer just to manually delete the lines inside the files. Let's say, my log contains entries for the last 10 days.The entries that refer to 9 days I would manually delete and leave there just the last day's entries. Is it something that's not gonna cause any damage to anything, I hope???
2 Answers
There is no harm in manually deleting sections of your logs, but I don't know why you would do that.
Normally systems use some form of log rotation to deal with issues like your.
For example on Debian
https://www.debian-administration.org/article/117/Creating_logfile_archives_with_logrotate

- 6,260
- 2
- 17
- 37
-
Thanks for your reply! I would think that there's something on Ubuntu that deals with logs, but right now I just want to ask about what I was asking in my original post. – Gregory Oct 24 '15 at 08:04
-
Well, then HBruijn has a point. You might miss some log entries while you're messing with your logs while the daemon is running. If you don't care much about that, I don't see what else could go wrong. – Ryan Babchishin Oct 24 '15 at 08:05
Despite your preference to manually edit it is much better to automate things. A concern is that Bind will be appending new lines to the log file while you are still editing it and once you finish editing and write your modified file to disk and you overwrite the original file, those new entries are lost.
Set up automatic log rotation and configure it to you requirements, please. That isn't very difficult, as nearly all Linux distributions come with Logrotate pre installed and you just need to add a Logrotate section for bind.

- 77,029
- 24
- 135
- 201
-
Thanks for your reply! Good point! But I can stop BIND, delete part of the log file and then start BIND. I'm not gonna mess with logs too often... Once a week maybe... – Gregory Oct 24 '15 at 08:09
-
1You are going to stop your companies DNS server just to mess with the logs ? – user9517 Oct 24 '15 at 11:06