I have a script which is called in a crontab. The script calls for 2 args when ran on the command line
The crontab line:
05 0-23 * * 0-6 /path/name %arg1 %arg1
I get the following output
Your "cron" job on server
/path/name
produced the following output:
Must be attached to terminal for 'am I' option
stty: : Inappropriate ioctl for device
Must be attached to terminal for 'am I' option
any help???????
your script might have a "tty" command in there somewhere.
possibly in a command with a bunch of pipes.
You should post the script contents and we'll see...
My guess is your script is checking for a terminal type but cron doesn't have a terminal so you get that error. It'd help if you posted the /path/name file if possible.
methyl
February 20, 2009, 10:41am
4
My guess is that the script contains the unix command:
who am I
That command will only work from a real terminal.
Your script may need something like:
if [ -t ]
then
who am I
fi
I have solved this now and i had some issues with the actual script:
i cd'd to my basepath but i had not set it before i called it.
Also the cron was wrong, i had:
05 0-23 * * 0-6 /path/name %arg1 %arg1
when
05 0-23 * * 0-6 /path/name arg1 arg1
was sufficient, thanks for the posts