1824169 Members
3324 Online
109669 Solutions
New Discussion юеВ

Mail with subject : cron

 
Tan Shirley
Frequent Advisor

Mail with subject : cron

Hi,

Any idea what the below mail is trying to say, and how can I resolve it as I've got lots of mails with subject "cron".

From root@newmfg Fri Oct 13 11:30:39 EAT 2000
Received: (from root@localhost) by newmfg. (8.8.6 (PHNE_17190)/8.7.1) id LAA1862
3 for root; Fri, 13 Oct 2000 11:30:38 +0800 (EAT)
Date: Fri, 13 Oct 2000 11:30:38 +0800 (EAT)
From: root@newmfg
Message-Id: <200010130330.LAA18623@newmfg.>
Subject: cron
Status: R

stty: : Not a typewriter
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:

/mfgpro/admin/batch/minutes > /mfgpro/batch/minutes.mon #batch job for every 10
minutes
2 REPLIES 2
Kofi ARTHIABAH
Honored Contributor

Re: Mail with subject : cron

Tan:

The explanation is as follows. You have a job that is invoked from the cron, but that generates an output which is not thrown away. In order to get it to be thrown away, you have to redirect the standard error/standard output to /dev/null or if there is a log file you want it to go to , specify that eg edit your crontab so that the line reads:

/mfgpro/admin/batch/minutes > /mfgpro/batch/minutes.mon 2>&1

This tells the system that any messages generated for Standard error (file descriptor 2) should be sent to standard output (file descriptor 1) which in the case of the above is redirected to the file /mfgpro/batch/minutes.mon

Hope this helps.
nothing wrong with me that a few lines of code cannot fix!
Andreas Voss
Honored Contributor

Re: Mail with subject : cron

Hi,

your messages are generated from the stty command. This command is trying to change terminal behavior but when doing by cron there is no terminal assosiated with a terminal.
So look in your batch scripts for any stty command.
Another senario is when the script uses the command: su - ...
Then the /etc/profile and $HOME/.profile of that user is executed. If there are stty command you get also these messages. To prevent this put any stty commands in the profiles whithin:
if [ -t ]
then
stty .....
fi
This ensures that stty commands are only executed when process is assisiated with a terminal

Regards