How to roll logs automatically??
Hello all,
Does anyone know how I should go about rolling logfiles automatically?? I have several logs that I do not want to purge, but do want to archive in some fashion. What would be a good procedure to roll the logs. Possibly have them roll automatically via script out of a crontab. I am still green to linux, but picking it up quick. I am willing to dive into a heavy script if i could have some direction. -sam |
Why re-invent the wheel? :} ... chances are you have to
logrotate already installed, and just need to modify it a bit for your needs? |
do you know what the module name is? and where it may be.....on RH9 standard install?
thanks, sam |
Depending on what syslog you use, it may even be a built-in function. I use metalogger, which keeps logs separate by itself. . .
|
The way I understand it, it's pretty standard on most systems. Try "whereis logrotate" to see if you have it and "man logrotate" to see how to use it.
|
logrotating directories
I have virtual servers and each virtual has its own serverlog. I keep all the serverlogs in a directory. If I specify the whole directory what will happen?
|
specifically.....
I have read man logrotate but it is not clear how to do directories.
here is the additional conf block I made #webserver access logs /usr/local/apache/logs { rotate 5 size=100k sharedscripts postrotate /sbin/killall -HUP httpd endscript } Here is what came back: rotating pattern: /usr/local/apache/logs 102400 bytes (5 rotations) empty log files are rotated, old logs are removed not running shared postrotate script, since no logs were rotated and the logs were unchanged. :cry: I definitely have some over 100K, they're killing my diskspace How can I clear out the ancient dreck, while keeping the last few weeks or so. Thanks for any hlp! |
All times are GMT -5. The time now is 10:43 PM. |