Cron error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron error
# 1  
Old 09-18-2010
Cron error

I am running the following cron job:

Code:
SHELL=/usr/bin/ksh; export SHELL; . $HOME/.profile; xxx.sh > xxx.out 2>&1

and I am getting mail with the folloinwg message mailed to me when I login as this user: stty: tcgetattr: Not a typewriter

I am running on an AIX 6.1 machine
Code:
oslevel -s
6100-03-06-1034

Here is the .profile of the user running the cronjob (see below) what does this mean and how can I fix it? thanks to all who respond.

Code:
cat /home/oracle/.profile 
 
stty erase ^?
set -o vi
EDITOR=/bin/vi
ORACLE_HOME=/u01/app/oracle/product/11.2.0.1.0
TNS_ADMIN=$ORACLE_HOME/network/admin
ORACLE_SID=pri
 
PATH=.:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/local/bin:$ORACLE_HOME/bin
 
export PATH EDITOR ORACLE_HOME ORACLE_SID TNS_ADMIN
 
if [ -s "$MAIL" ]           
then echo "$MAILMSG"  
fi


Last edited by Scott; 09-18-2010 at 05:52 PM.. Reason: Please use CODE tags
# 2  
Old 09-18-2010
Quote:
Originally Posted by BeefStu
cat /home/oracle/.profile
...............
Code:
stty erase ^?

....
stty
set the options for a terminal, at cron you haven't terminal
you can't use the command

My propossition, change job;
Code:
SHELL=/usr/bin/ksh; export SHELL; . $HOME/.profile 2>/dev/null ; xxx.sh > xxx.out 2>&1


Last edited by john1212; 09-18-2010 at 05:01 PM.. Reason: add propossition
# 3  
Old 09-19-2010
... or within the .profile test for terminal context

Code:
if [ -t 1 ]
then
         stty erase ^?
fi

# 4  
Old 09-20-2010
Quote:
Originally Posted by methyl
... or within the .profile test for terminal context

Code:
if [ -t 1 ]
then
         stty erase ^?
fi

Nice trick, where can I find the man page regarding the -t option. I would like to read up on this.

Thanks all for your help.
# 5  
Old 09-20-2010
Quote:
Originally Posted by BeefStu
Nice trick, where can I find the man page regarding the -t option. I would like to read up on this.

Thanks all for your help.
Code:
man test

[ -t 0 ] checks if the stdin in the given script is a terminal.
[ -t 1 ] checks the stdout.
This User Gave Thanks to Franklin52 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help please error cron

Hi all, I write from 'Italy (sorry for my english) I have a joomla site, some days I get an error with cronjobs I do not know how to fix it (I'm not an expert) I kindly ask you to help you who are more experienced the error is this: Status: 403 Forbidden Set-Cookie: =... (1 Reply)
Discussion started by: arredoannunci
1 Replies

2. UNIX for Dummies Questions & Answers

cron error

Hi all, I am brand new in linux and not sure where to post this i posted it also on debian but i think this place would have been better. I have a cron log error which i am trying to locate if anyone has any ideas that would be really appreciated ################### Logwatch 7.3.6... (3 Replies)
Discussion started by: stav40
3 Replies

3. Debian

cron error

Hi all, I am brand new in linux and i have a cron lon error which i am trying to locate if anyone has any ideas that would be really appreciated ################### Logwatch 7.3.6 (05/19/07) #################### Processing Initiated: Thu Nov 10 06:25:26 2011 Date Range... (0 Replies)
Discussion started by: stav40
0 Replies

4. UNIX for Dummies Questions & Answers

cron output error

I am attempting to run a cron job, however, I receive this cron output error: Error: of parameter : xxxxx does not make a valid output file. What causes this? (4 Replies)
Discussion started by: AM1234
4 Replies

5. Shell Programming and Scripting

cron job error

HI am having a script file which is ok if i run from the server manually like <root@hostname:/space/canvas/home/lbs/current/internalcdrbackup/LES_CDR_Configuration/0/MSISDNcdrCount > /space/canvas/home/lbs/current/internalcdrbackup/LES_CDR_Configuration/0/MSISDNcdrCount.txt the... (2 Replies)
Discussion started by: aemunathan
2 Replies

6. Shell Programming and Scripting

Error in cron job;

Hi All, please help me out with this problem. While running my mail_out_original.ksh in CRT window, it disconnects from the server saying not connected Here is my code : (please see the attachment) ____________________________________________________________ #!/bin/ksh ## Load... (1 Reply)
Discussion started by: shruthinagaraj
1 Replies

7. Shell Programming and Scripting

cron entry error

I am using the following cron entry to run a cron job every 4 hours and it is rejecting it: 0 */4 * * * /home/location/scriptname When I put this entry in cron is errors with: 0481-079 reached a symbol that is not expected. This is an AIX 5.3 system Any ideas? Thanks (6 Replies)
Discussion started by: capeme
6 Replies

8. UNIX for Dummies Questions & Answers

cron error

I am using the following cron entry to run a cron job every 4 hours and it is rejecting it: 0 */4 * * * /home/location/scriptname When I put this entry in cron is errors with: 0481-079 reached a symbol that is not expected. This is an AIX 5.3 system Any ideas? Thanks (4 Replies)
Discussion started by: capeme
4 Replies

9. Filesystems, Disks and Memory

mmap error - only when from cron?!?!?

Hey Guys, Ive got a script which when run from the command prompt works exactly as planned. However when this script is scheduled to run from the crontab (using the same user ID) it brings up a series of mmap errors... + /opt/cobol/bin/rebuild /cybtirl/data/file02 -k:4+32 -e -i -v Error... (1 Reply)
Discussion started by: Bicks
1 Replies

10. UNIX for Dummies Questions & Answers

Script/cron error

I am running a script through cron but keep getting this message in unix mail: Subject: cron Not a terminal stty: : Not a typewriter stty: : Not a typewriter logout The script appears to run successfully. Any ideas what this message is and how I can stop it? (1 Reply)
Discussion started by: Bab00shka
1 Replies
Login or Register to Ask a Question