Operating System - Linux
1754960 Members
2505 Online
108827 Solutions
New Discussion

schedule rotate of the system logs

 
R.O.
Esteemed Contributor

schedule rotate of the system logs

Hi,

¿How can I schedule the time of the rotation of the system logs, i.e, messages, cron, etc..?
My system is a Red Hat 2.1 AS
Thank yo
"When you look into an abyss, the abyss also looks into you"
2 REPLIES 2
Ragu_3
Trusted Contributor

Re: schedule rotate of the system logs

Install the `logrotate' package. It takes care of everything. ;-)
Debian GNU/Linux for the Enterprise! Ask HP ...
Muthukumar_5
Honored Contributor

Re: schedule rotate of the system logs

We can do it using logrotate or with crontab.

Using logrotate:

lograte will do this effectively. configure in /etc/logrotate.conf.

Check in your system weather logroate is there or not as,
rpm -qa logrotate
or whereis logrotate

If you have use logrotate --help and see logrotate man page.

Using cron tab:

Make a script to move the to /dev/null or to a modified file with cp or mv command.

Then put that script in a crontab so that it will be executed on the specified to rotate the logs regarding to your script design
Easy to suggest when don't know about the problem!