I have a ubuntu server which handles mail via postfix. The server has recently been caned by spam emails and the mail logs are really large as a consequence. The logs are stored with timestamps and I was just wondering if I can just clear out the old logs without consequence to recover some disk space?
Also, being none-too-clever about such things, I am struggling to see where to change the settings for log rotation and deletion… any clues from more knowledgable folks?
Best Answer
If you dont care about what you'll be missing, you have two ways of removing the content of logfiles. One, is of course, removing it, but if you do this, the file will still exist with its content (syslog daemon has it open, and appending content to it).
Depending on what syslog daemon you are using, just replace its name, as well as the maillog.
The other way arround, is to truncate the file:
Logs on Debian-like systems are usually rotated with logrotate. In /etc/logrotate.d you'll find config files, and man can help you a lot. It is fairly simple to setup.