lwfuk
asked on
CentOS5.2 How do I prune my log files with Cron?
Hello
With Regard to CentOS 5.2
My log files are getting quite big and I would like to setup a cron/shell script that keeps them to about 100kb.
Does anybody have a readymade solution?
Kind Regards,
Adrian Smith
London
With Regard to CentOS 5.2
My log files are getting quite big and I would like to setup a cron/shell script that keeps them to about 100kb.
Does anybody have a readymade solution?
Kind Regards,
Adrian Smith
London
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Look in /etc/logrotate.d/.
You can replicate any one of the files there.
man logrotate will provide you information and examples you can use to create a logrotate file you can place into /etc/logrotate.d/.
The links posted earlier explain and provide additional/detailed examples.
You can replicate any one of the files there.
man logrotate will provide you information and examples you can use to create a logrotate file you can place into /etc/logrotate.d/.
The links posted earlier explain and provide additional/detailed examples.
logroate will do this job for you .
logroate should keep log file archived
http://www.linuxcommand.org/man_pages/logrotate8.html
just in google do a search for logrotate ,