script not running as a cron job
Hello all,
a shell script which i have made for some automation works when i run it manually. but the same script dosent work as a cron job. Does any one out there have any idea why it is like this. the script basically runs prebuilt scripts owned by diffrent users( call's 1 by 1) thanks SaN |
Try set the PATH with directory where your prebuilt scripts are located in crontab. Did you check
your mail to see the logged errors ? crontab -e example : Code:
# you could put env variables here |
Is there any way to emulate the cron behaviour from the shell itself , so that i can test the script easily without waiting for the cron job to happen.
|
To test your cron you could try :
- on a terminal, type : tty, note the result - set a cron as this, say your tty is /dev/pts/1 : * * * * * date >> /dev/pts/1 Now look at your terminal how things go |
or better:
Code:
* * * * * date > /dev/pts/1 2>/dev/pts/1 |
I had a similar problem, but I fixed it:
It was because I ran some other scripts, from the script. These were not working, because I did not include the full path. Maybe you're having similar problems, try including full path's to the executables in the script, it might work. It did for me ;) |
All times are GMT -5. The time now is 05:00 PM. |