August 31st, 2006, 10:07 AM
Setting Up Cron job on AIX
I need assistance on creating a cron job on Aix Unix that will run a batch job at an interval of 10 minutes everyday.
Getting the cron job, will save me from telneting into the server , cahanging to the path before running the batch job at prompt every time.
I will appreciate immediate response from anyone because I need to deliver this assignment this week.
August 31st, 2006, 01:42 PM
That'll get you into edit mode for your crontab. Then, just insert the timing and job options:
That should do it. You need to be familiar with the vi editor to modify your crontab. Unless you've configured your system for a different default editor.
00,10,20,30,40,50 * * * * /path/to/script
September 1st, 2006, 11:24 AM
Thank you. I have try what you suggested but, the cron job is not running.
I tried running the script at command line and it is responding but the cron is not running as specified.
please what else can I do to get this cron job working.
September 1st, 2006, 11:32 AM
Is the cron daemon running?
I'm not sure if ptree is available on AIX, I guess you could use ps though
# ptree | grep cron
22652 grep cron
# ps -aef | grep cron
September 4th, 2006, 01:57 PM
I have run the comand
ps -aef |grep cron
the result is ...
root 24278 1 0 Jul 28 - 0:09 /usr/sbin/cron
cdci 40916 16782 1 18:30:06 pts/1 0:00 grep cron
This shows that the cron is running.
May be I need to give more detail of what I want to achieve.
I have a script called atm, this script is to monitor some processes . I want this script to now be run at an interval of 10mins everyday.
I want the output from this script to be displayed automatically on the VDU each time the cron job is run.
I created two additional files, a text file and another scripts that is called monitor, the content is thus
then I now use
tail -f view
00,10,20,30,40,50 * * * /akin/cdci/CBC/cbc/log/monitor
I use tail to view the result of the cron tab, but this is not running., But running the script at command line gives the result.
I hope with this is detail, that I will able to get more assistance.
September 7th, 2006, 07:39 PM
Some things to check:
1. Check the cron log to see if the script ran or not - /var/log/cron on freebsd, varies from OS to OS though (just noticed you say AIX in the title of the post - maybe try /var/adm/cron/log?
2. Ensure any filenames inside the 'monitor' script use absolute pathnames - cron runs with a limited PATH so might not find any commands if you use a short executable name - ie use '/usr/local/bin/some_proggie' instead of just 'some_proggie'.
3. Check you mail to see if any error messages were displayed when cron tried to run the script. Cron usually directs any errors to the mail account of the user the job is running as.
Also note you can shorten
to run the script every 10 minutes.
The man pages for cron and crontab can be very helpful too
January 16th, 2008, 01:13 PM
August 4th, 2009, 06:46 AM
Please try like this
0,30 * * * * script name
this will run the script every 30 minutes , you just have to seperate with comma for every x minutes
August 4th, 2009, 08:31 AM
18 months late, but thanks!
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc