Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron errors running script every 5 mins

Status
Not open for further replies.

smithia6

Technical User
Aug 28, 2002
35
0
0
US
Hi I am trying to set up cron jobs on a Sun Solaris 8 server and getting nothing but errors back.

I want my 2 scripts to run every 5 mins.

I have tried this:-

*/5 05-22 * * 1-5 /export/home/smithia6/myscript1.sh
and I get this :-
crontab: error on previous line; unexpected character found in line.

I have tried this:-
0-59/5 05-22 * * 1-5 /export/home/smithia6/myscript1.sh
I get this :-
crontab: error on previous line; unexpected character found in line.

I have tried this :-
5,10,15,20,25,30,35,40,45,50,55,60 05-22 * * 1-5 /export/home/smithia6/myscript1.sh
And I get this:-
crontab: error on previous line; number out of bounds.

Can anyone help I am running out of things to try.

Regards

Ian
 
Hi,

have you check you script? When you said error, did you get the error when you save the cron job or when you run the program?

dbase77
 
I create the cron jobs in a text file I call crontab.txt.

Once I am happy with it I issue the following command.

crontab crontab.txt

This usually works fine, I check it by doing a crontab -l

However these errors are occurring whilst issuing the command crontab crontab.txt

Regards

Ian
 
You can only have 0-59 for the minutes, 60 is invalid and hence the error. The other things you have tried are just wrong.
minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday).

try
0,5,10,15,20,25,30,35,40,45,50,55 05-22 * * 1-5 /export/home/smithia6/myscript1.sh


I love deadlines. I like the whooshing sound they make as they fly by - Douglas Adams
 
Ahhhhhh that did the trick, I got carried away with the 5,10,15,20 etc ... didn't know when to stop.

Regards

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top