1836438 Members
3352 Online
110100 Solutions
New Discussion

cron job

 
SOLVED
Go to solution
thebeatlesguru
Regular Advisor

cron job

following is my cronfile:
03 11 * * * /usr/bin/ok >> /home/pin/ok.log 2>&1
0,5,10,15,20,25,30,35,40,45,50,55 * * * * ping 202.96.232.8 -n 2 >> /home/pin/ping.log 2>&1

/usr/bin/ok is a shell script
i find second mission is done,and i can find ping.log,but first mission is not done,i cant find ok.log.
why?

hihi
10 REPLIES 10
Steven Sim Kok Leong
Honored Contributor

Re: cron job

Hi,

Can you show us your ok script?

Are there any errors (RC return codes)in your /var/adm/cron/log? Check whether there was any RC return code worth referring to.

Hope this helps. Regards.

Steven Sim Kok Leong
Animesh Chakraborty
Honored Contributor

Re: cron job

#touch /home/pin/ok.log
#chmod 777 /home/pin/ok.log (atleast give write permission to ok.log)
Did you take a backup?
Deepak Extross
Honored Contributor
Solution

Re: cron job

could be a problem with your local date setting.
Set the first job to run at 5-min intervals
0,5,10,15,20,25,30,35,40,45,50,55
as well, same as the second one.
thebeatlesguru
Regular Advisor

Re: cron job

but i didnt touch /home/pin/ping.log,the log is made by cron .
hihi
thebeatlesguru
Regular Advisor

Re: cron job

Deepak is right,it is a problem with local date setting.
i wanna know if i want to start at 08:30am everyday,
30 08 * * * ,isn't it?
hihi
Michael Tully
Honored Contributor

Re: cron job

Hi,

The crontab entry you have is correct:

30 8 * * * /usr/bin/yourprogram

The man page indicates all of this information:

The entries are:

MIN HOUR DAYOFMONTH MONTH WEEKDAY
Anyone for a Mutiny ?
thebeatlesguru
Regular Advisor

Re: cron job

but
why 30 8 * * * /usr/bin/yourprogram

does not work
however 0,5,10,15 * * * */usr/bin/yourprogram
work well
hihi
Deepak Extross
Honored Contributor

Re: cron job

what is the output of the 'date' command on your system?
thebeatlesguru
Regular Advisor

Re: cron job

# date
Thu Feb 21 07:42:42 EST 2002
# date -u
Thu Feb 21 12:42:46 UTC 2002
hihi
Deepak Extross
Honored Contributor

Re: cron job

Right..so you'll have to wait for 45 minutes before your job runs. (at 08:30 a.m.)