Operating System - HP-UX
1827211 Members
2476 Online
109716 Solutions
New Discussion

Re: CRON Problem - HPUX Server thinks it's a typewriter

 
SOLVED
Go to solution
Laurie_2
Advisor

CRON Problem - HPUX Server thinks it's a typewriter

Hi All,

My cron job keeps sending me this email:
stty: : Not a typewriter
stty: : Not a typewriter

*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

HOME=/home/carsids/saraf; USER=saraf; LOGNAME=saraf; CARSNAME="Park University"; CARSADDR="8700 River Park Drive, Beverly Hills, CA 90210 "; CARSDB=cars; CARSV=carsi; CARSPATH=/opt/carsi; export HOME USER LOGNAME CARSNAME CARSADDR CARSV DBPATH CARSPATH;/bin/csh -c '/opt/carsi/install/scp/util/ftpfile.scp >/tmp/PC_ezproxy.log' 2>&1;/bin/csh -c 'mailx -s "PC Ezproxy Process Complete" saraf < /tmp/PC_ezproxy.log'

Why is my cron job trying to go to a typewriter? What's wrong with my syntax for
my cron job? The cron job still works I'm
just getting sick of these email messages.

TIA,
Laurie
How can you make the world a better place
7 REPLIES 7
melvyn burnard
Honored Contributor

Re: CRON Problem - HPUX Server thinks it's a typewriter

This explanation of the error message may help:

Not a typewriter

You can get this message from many sources. Usually, the message means
you executed a program that expects to deal with a terminal and you have
forced the program to deal with a different device.

Also, in some programs, a call to stdio(3) sets an ERRNO that does not
get cleared up. Then, if you get another error, this message also pops
up.

Also, attempting to access an RS-232 port without having configured the
kernel to support the card for the port can cause the error.

Also, when you start cron, and when a person changes cron's FIFO
(/usr/lib/cron/FIFO) to be a regular file (-rw-rw-rw-) instead of a pipe
(prw-------), the message can be appended to cronlog, and this can keep
going until the system runs out of disk space. Kill cron, remove the
FIFO, and restart cron. Cron creates a new FIFO the correct way.

In some cases, the message can mean nothing; just continue to work.





Could be your stdout/stderr redirect is also incorrect
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
S.K. Chan
Honored Contributor

Re: CRON Problem - HPUX Server thinks it's a typewriter

Typically this is due to the "tty" or "stty" staements that resides in .kshrc (if you're using ksh), what I usually do is had those setting in .profile instead of .kshrc, re-read all my profiles and those message should go away.
someone_4
Honored Contributor

Re: CRON Problem - HPUX Server thinks it's a typewriter

Try this to redirect your output.
Just add this line to the top of the cron job before the script starts.

exec > /tmp/output 2>&1 # to redirect both in same file
exec > /tmp/output 2>/tmp/error # to redirect in different files


~ Richard
Martin Johnson
Honored Contributor

Re: CRON Problem - HPUX Server thinks it's a typewriter

Have you checked /etc/profile and your .profile for calls to stty? Somewhere you are trying to change the setting of the tty and jobs running in cron do not have ttys associated with it.

HTH
Marty
Sajid_1
Honored Contributor

Re: CRON Problem - HPUX Server thinks it's a typewriter

hello,

If you are using Ksh or Posix shell, this can happen. Check in .kshrc for any tty and stty commands. You will find you have a few tty and stty in there. You shouldn't have this type of command in .kshrc, they need to be moved to .profile. You need to logout and log back in for changes to take effect.

rgds,

learn unix ..
Michael Tully
Honored Contributor
Solution

Re: CRON Problem - HPUX Server thinks it's a typewriter

Hi,

Try putting something into your script.

-------------------------------
TTY=`/usr/bin/tty`
if [ "$TTY" = "not a tty" ]
then
TTY=/dev/null
fi

-------------------------------

HTH
Michael
Anyone for a Mutiny ?
bryanh_1
Occasional Advisor

Re: CRON Problem - HPUX Server thinks it's a typewriter


Put any stty commands which are in your .profile inside of an 'if' block"

if [ -t 0 ]; then
stty $whatever
fi

This test says 'if standard input (file descriptor 0) is a tty then' ...