1847099 Members
4980 Online
110263 Solutions
New Discussion

Trimming the cron log

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Trimming the cron log

On one of our 11.00 boxes, the /var/adm/cron/log file has gotten rather large. Is it okay to trim this file on the fly? Is there anything built into HP that keeps a handle on this log file or should we write our own script to purge this file occasionaly?

5 REPLIES 5
Rick Garland
Honored Contributor

Re: Trimming the cron log

On the porting center is a logtrim tool that will assist you in doing this.
Darrel Louis
Honored Contributor

Re: Trimming the cron log

Yes you can trim it on the fly.
What you can do is make a script, which will copy the log file to a new file and clear the original file.

Good luck
James R. Ferguson
Acclaimed Contributor

Re: Trimming the cron log

Greg:

You can use SAM to do these tasks. Click on Routine Tasks -> System Log Files... and trim away. SAM allows you to add files to be presented for potential trimming by choosing the ACTIONS tab of this dialog.

...JRF...
CHRIS_ANORUO
Honored Contributor
Solution

Re: Trimming the cron log

You can include this command in your cron file for every quarter "cat /dev/null > /var/adm/cron/log". But actually, whenever you reboot your system it moves it to /var/adm/cron/OLDlog
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Kofi ARTHIABAH
Honored Contributor

Re: Trimming the cron log

You might want to look at
http://eigen.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/

however, I suspect that you might be better off restarting the cron every now and again...

/sbin/init.d/cron stop ; /sbin/init.d/cron start

BTW do you ever reboot your server? because every time that you restart the server/ restart the cron.

You might also want to look at why the cron logs are growing - perhaps you need to stream line some of the items in it.
nothing wrong with me that a few lines of code cannot fix!