Translate

Monday, 25 August 2014

Managing you cron logs

Previous versions of AIX would keep writing to the same cronlog until either the disk filled, you restarted the process, or manually managed the file. AIX 6.1 introduced the "/etc/cronlog.conf" configuration file and it is now possible to automatically limit the size of the log file an to automatically rotate versions e.g.

logfile=/var/adm/cron.log
size=100K
rotate=4
archive=/usr/home
compress

Will write to "cron.log" and automatically rotate and compress it:

# ls -l /var/adm/cron.log*
-rw-rw-r--    1 root     cron          79986 Aug 25 14:00 /var/adm/cron.log
-rw-rw-r--    1 root     cron          15301 Aug 12 13:40 /var/adm/cron.log.0.Z
-rw-rw-r--    1 root     cron          15018 Aug 16 11:45 /var/adm/cron.log.1.Z
-rw-rw-r--    1 root     cron          14334 Aug 18 13:45 /var/adm/cron.log.2.Z
-rw-rw-r--    1 root     cron          14878 Aug 21 06:40 /var/adm/cron.log.3.Z


No comments:

Post a Comment