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'
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 40 18 * * 1,2,3,4,5 ( . /home/lpar/.bash_profile ; /myscript/script01.sh ) >/dev/null 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
Fields description
On linux (NOT AIX) you can also use for very 10 minutes, */10
0,10,20,30,40,50 6 * * 1-5 /usr/bin/calendar */10 * * 1-5 /usr/bin/calendar
Default log output is located in/var/adm/cron/log
You can use logrotate mechanism to rotate this log, or choose the following steps
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
I found that the log is located in /var/adm/log. Further we are getting this error repeatedly ever since this date/time. How do I clear this max limit?
c queue max run limit reached Fri Nov 25 21:52:00 2016 ! rescheduling a cron job Fri Nov 25 21:52:00 2016
The cron daemon has a limit of how many jobs it can run simultaneously. By default it is 100 jobs. If a new job is scheduled to run, and the limit has already been reached, the job will be rescheduled at a later time (the default is 60 seconds later). Both the number of jobs and wait time are configured in the file /var/adm/cron/queuedefs.
To do this, add an entry to the bottom of the /var/adm/cron/queuedefs file using an editor such as vi. The entry should have the form:
c.50j20n60w
where
For example:
This example would set the cron queue to a maximum of 200 jobs, with a nice value of 2, and a wait time of 60 seconds.
root@orathal-test /var/tmp# cat /var/adm/cron/queuedefs c.200j2n60w
c.200j2n60w