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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRON job not running...

Status
Not open for further replies.

SuaveRick

Programmer
Apr 12, 2004
142
CA
Hello, I have a job that I want to run using the CRON. I want it to run every 15 minutes but it appears that it is not running when it should. I just used the crontab -e and added it... the path and everything is fine so maybe one of you can pick something up:

15,30,45,59 * * * * . /unix_scripts/space_check/space.sh

Thanks!!!
 
Why using the dot operator ?
Have you tried to add I/O redirection (> and 2>) ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It turns out that the script is running but the output files that should be there are not. Would they be stored somewhere else when this job runs?
 
If you don't redirect them as PHV suggests, or write a log somewhere in the script, they are sent to standard output/standard error, usually the scrteen. As cron doesn't have a 'screen' they'll disappear. Do you receive any email to the effect that the job has run?
 
I don't get any e-mails no. If I use the redirection it's just:

59,15,30,45 * * * * /blah/blah/blah/script.sh > /blah/blah/scriptout.log

Would that be all you have to do?
 
Better might be:

59,15,30,45 * * * * /blah/blah/blah/script.sh > /blah/blah/scriptout.log 2>&1

which will send all logging (inc errors) to scriptout.log.

HTH.


 
When I was having problems I wans't sure if I could use 0 or oo so I just used 59 to be safe, now I know I can use 00 and have since changed it.

Thanks for the tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top