I have a shell script which mails a file. It runs fine when executed at prompt, but from cronjob the following line gives an error:
HTML Code:
$ /opt/local/bin/mpack -s "TTW posts " $FILEPATH/ttw.html myemail@gmail.com
Error is : (some junk chars) followed by
No such file or directory.
Before this line ,I have `
head`ed the file to ensure it is found by cron - IT IS. I have also `
which`ed mpack and it (cron) gives the full path. So I am stumped as to why it should fail from cron. Both file and executable are found!
Strangely, after this I also
'links -dump' the file and use mail to mail it to my localhost. Links is also in /opt/local and this line works fine. However, since the stock '
mail' program cannot send an attach, therefore I needed to use mpack.
Doing
'ls -l' on mpack shows it is readable and executable by all -- same as other commands in /opt.