Configure log file for cron daemon on AIX

Cron daemon log in by default on /var/adm/cron/log, but I wanted to put it with all other logs of the system.
All system logs (syslog, mksysb, ftp, http, and so on, are on /var/syslog filesystem, I decided to put cron logs in the same place. Here’s what I did.

Add this lines to the end of file /etc/cronlog.conf

logfile=/var/syslog/cron.log
size=2m
rotate=4
archive=/var/syslog
compress

As cron is started from inittab it will respawn when you kill the PID.

[root@aix:/] cat /etc/inittab|grep cron
cron:23456789:respawn:/usr/sbin/cron

So, just kill cron’s PID (10748102 in this case)

[root@aix:/var/adm/cron] ps -ef|grep cron
    root 10748102        1   0 18:35:42      -  0:00 /usr/sbin/cron

Note also that cron log wil be rotate and compress. See:

[root@bibmnim:/var/adm/cron] ls -ltr /var/syslog/
total 18752
drwxr-xr-x    2 root     system          256 Mar 01 2011  lost+found
-rw-rw-r--    1 root     cron         164711 Apr 21 23:58 cron.log.0.Z
-rw-rw-r--    1 root     cron         165926 Apr 27 12:29 cron.log.1.Z
-rw-rw-r--    1 root     cron         165527 May 03 01:01 cron.log.2.Z
-rw-rw-r--    1 root     cron         164224 May 08 13:45 cron.log.3.Z
-rw-rw-r--    1 root     cron           1493 May 13 18:41 cron.log

That’s it!

Just thanks if the post was helpful

5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
DISK OPERATION ERROR in AIX
Viewed 14343 times since Thu, Feb 21, 2019
Monitor logfiles and command output on AIX using multitail.
Viewed 2404 times since Thu, Feb 21, 2019
AIX 6.1: Extend VG 0516-1714 extendvg 0516-1254 extendvg
Viewed 4594 times since Fri, Jul 6, 2018
AIX PDF ALL
Viewed 6705 times since Mon, Jul 16, 2018
vfcpmap on VIO Server
Viewed 9618 times since Tue, Jun 4, 2019
Convert to Scalable Volume Groups
Viewed 4039 times since Wed, May 30, 2018
AIX Replacing a failed disk (rootvg)
Viewed 8780 times since Tue, Jul 17, 2018
A Unix Utility You Should Know About: lsof
Viewed 2018 times since Tue, Apr 16, 2019
How to Use the Linux lsof Command
Viewed 11745 times since Sun, Jun 30, 2019
AIX -- extending Logical Volumes online
Viewed 2833 times since Tue, Mar 12, 2019