This content has been marked as final. Show 3 replies
Hmm, no idea as such, but i though
was ksh syntax which worked only in ksh? (and possibly bash). Whereas most scripts ran from crontab are executed in the quite dumb /bin/sh with a quite basic environment, perhaps this could cause this error?
Also, according to your cron/log, the cronjob takes 0 seconds, which is suspiciously fast..
I have used bash scripts in and they run just fine in cron.
However, I did see in the man page of exec that they have mentioned options only for "sh/csh/ksh" but not bash. Which is a bit odd. Still, I don't think this can be a reason. As i ran exec in bash and runs fine.
Appreciate if you can find a way of finding what exactly is the problem.
It war very usefull and intresting found for me BASH capabilities work with socket.
I try use your commands for script but shell found some errors.
For test I use next script:
cat << EOF >&3
MAIL From: <$from>
RCPT To: <$email>
cat <&3 > $LOG
1) #!/bin/bash - Critical. becouse /bin/sh can't use tcp socket
2) I can't reproduce this error when start this script via cron. It's work fine.
3) In case of error's Log look like
> CMD: /tmp/n2
root 7770 c Mon Feb 7 01:22:00 2011< root 7770 c Mon Feb 7 01:22:00 2011 rc=1
(Without exec ..... )
4) When cron jobs generate any output to stdout, stderr - this iutput put to E-mail of users who start this cron jobs.
So try look mail for root. It can content more details about problem.