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!

Crontab Entry 1

Status
Not open for further replies.

jehixson

Programmer
Oct 15, 2003
12
0
0
US
I have written a small script to run on our servers. I wanted to place it in the crontab so it will run automatically. When I place the entry in the crontab, it does not run. This is what I have entered.

00 13 * * 4 /weekly

I want the script to run at 1pm on wednesdays.

The file is located in the root directory and I placed the #!/bin/sh in the first line of the script. It is not actually a script moreless just a few UNIX commands checking disk status and things like this.

Any help would be appreciated.
 
Check whether the actual file itself is executable - I had a similar problem which drove me mad for days, until I realised it was a read-only file!

Sarah
 
As well as Sarah's suggestion, use the full pathname of the commands in question, as cron uses a very limited environment which might not incluse all environment variables (particularly $PATH) to enable you to run the script. As far as Stefan's post is concerned, the double 0 is OK, but as he says, on most systems/flavours Wednesday is day 3 (0 being Sunday and so on). hth.
 
What OS? Some SCO have a built in problem that shows up the same way.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Thank you everyone for your help. I did change the date to a 3 to run on Wednesdays however, I have to change the file permissions to 750 to make it executable. I tested and it runs gfreat.

Again thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top