User:Roger/Log rotate

From Wikigogy

Jump to: navigation, search
Too big
-rw-r--r-- 1 root wheel 150M May 23 01:03 /var/log/httpd-access.log

Should I rotate my logs?

[edit] rotatelogs

I'm working on this:

man rotatelogs

2592000 is 30 days measured in seconds (60x60x24x30).

# rotatelogs httpd-access.log 2592000

[edit] newsyslog

newsyslog

"FreeBSD provides a basic log file handler, newsyslog. Click here to find out more!

The newsyslog program handles standard log file rotation. The oldest logs are deleted. Each old log is renamed. Finally, the current log is moved and a new log file is created. The newsyslog program can also compress files, restart daemons, and in general handle all the routine tasks of shuffling files." more

Personal tools