Operating System - HP-UX
1832275 Members
2245 Online
110041 Solutions
New Discussion

cron entries not running as expected

 
sstan
Frequent Advisor

cron entries not running as expected

Hi guys,
cron daemon is running, and i had a root cronjob to start the task at 9:30am the job had to run from monday - friday as e.g entry:

30 9 * * 1-5 ./path/test.sh

but i check the /var/adm/cron/log but found no entry . the test.sh suppose to write some text to a text file but after 9:30am i check and found it was empty.

any one can pinpoint error , any help is appreaciate.

4 REPLIES 4
Michael Tully
Honored Contributor

Re: cron entries not running as expected

Cron is really stupid. If you want a job to run, you MUST supply the full path the program/command. You can't use ./

30 9 * * 1-5 /usr/local/bin/test.sh
Anyone for a Mutiny ?
Bill Hassell
Honored Contributor

Re: cron entries not running as expected

And to amplify Michael's reply just a bit, cron does not login--it just runs the program on your behalf. So anything that happens in your login profiles will NOT happen in your cron job. You can use the command: set to see all the current login values, then use the same command in your script and you'll see that almost nothing is supplied. You may have to add additional variables to yuor script.


Bill Hassell, sysadmin
sstan
Frequent Advisor

Re: cron entries not running as expected

hey all,

thanks for all valuable time ...

many thanks.
sstan
Frequent Advisor

Re: cron entries not running as expected

thanks for solutions.