User Tools

Site Tools


aix:aix_crontab

This is an old revision of the document!


AIX crontab / scheduling

Crontab in edition mode

You can use either crontab -e <user> or a file to overwrite the crontab

Add crontab

[root@aixna001]/root# echo '* * * * * /usr/bin/perl /opt/lpar2rrd-agent/lpar2rrd-agent.pl lnxmonitor01 > /var/tmp/lpar2rrd-agent1.out 2>&1' > /tmp/cron_lpar2rrd
[root@aixna001]/root# su - lpar2rrd -c 'crontab  /tmp/cron_lpar2rrd'

Check crontab

List crontab for a user

[root@aixna001]/root> crontab -l lpar2rrd
0 1 * * * /usr/bin/perl /opt/lpar2rrd-agent/lpar2rrd-agent.pl lnxmonitor01 > /var/tmp/lpar2rrd-agent.out 2>&1

Check latest appied crontab

[root@aixna001]/root> crontab -v lpar2rrd
Crontab file: lpar2rrd     Submission time: Thu Jan 11 09:32:45 CET 2024

Crontab and log management

By default on AIX cron process use the file /etc/cronlog.conf to customize cronlog.
In this file you can easily rotate cron logfile.

To log information in directory /var/cronjobs, log file cron.out, size of 50k, total number of rotated files = 4, archive in /var/cronarch, archive files with compression, create the configuration file as follows:

[root@aix001] /root> cat  /etc/cronlog.conf
...
logfile=/var/cronjobs/cron.out 
  size=50K 
  rotate=4 
  archive=/var/cronarch
  compress
aix/aix_crontab.1704964060.txt.gz · Last modified: 2024/01/11 10:07 by manu