1753768 Members
5333 Online
108799 Solutions
New Discussion юеВ

Cron Job issue

 
V.P
Frequent Advisor

Cron Job issue

Dear All,

The cron job is not running. Enclosed is the details.
HP-UX: 11.23
-----------------
Error:
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
stty: : Not a typewriter
age is the standard output
and standard error of one of your crontab commands:
------------------------
Thanks in advance.

9 REPLIES 9
Steven Schweda
Honored Contributor

Re: Cron Job issue

> stty: : Not a typewriter

So, what's in
"/cardprod/batches/LiveSync.sh", and is it
(somehow) doing a bunch of commands (like,
say, "stty") which make sense only with an
interactive terminal (which a "cron" job does
not have)?
V.P
Frequent Advisor

Re: Cron Job issue

Previously this was working fine. Any way the script is:
----------------------------
#This script must be invoked by crontab once every minute to process HPS embossing files
. /.profile > /dev/null

export PROC_EXEC=/cardprod/batches

#while true
#do
sleep 10
echo -----------------------------------
java -classpath /cardprod/batches/ LiveSync
echo -----------------------------------
sleep 30
java -classpath /cardprod/batches/ LiveSync
#done
-------------------------------------------
Steven Schweda
Honored Contributor

Re: Cron Job issue

> Previously this was working fine. [...]

> . /.profile > /dev/null

So, I'll guess that "Previously" involved a
different "/.profile" (or "/etc/profile", or
some other thing which gets sucked in
directly or indirectly by this ".profile").

Wow. I would not use a hard-coded name of
"/.profile", either. Around here, root's
home is "/root", so there is no "/.profile".
I'd think that "~root/.profile" would be more
reliable (especially on a Linux system, where
"/root" is common).

A search for keywords like, say,
cron stty
might find some examples of popular ways to
restrict execution of commands like "stty" to
interactive situations.
Dennis Handly
Acclaimed Contributor

Re: Cron Job issue

>The cron job is not running.

How do you know it's not running? Other than the extra output, it might be working fine?

>. /.profile > /dev/null

If you don't want to fix your ~/.profile, you could redirect stderr too:
. ~/.profile > /dev/null 2>&1

>This script must be invoked by crontab once every minute

Looks like it only needs to be invoked once by cron and then it does runs every 10 then 30 seconds.
V.P
Frequent Advisor

Re: Cron Job issue

Hi Denis,

The script is for moving the file from one folder to the other folder. We colud see the files are available in the generated path itself.

What is the issue with the profile? Earlier the same script was working fine. Any modification required, please let me know.
------------------------
Error in: /var/mail/root.
From root@hphost25 Sat Mar 6 23:32:00 uae 2010
Received: (from root@localhost)
by hphost25 (8.11.1 (PHNE_35951)/8.11.1) id o26JW0V14578
for root; Sat, 6 Mar 2010 23:32:00 +0400 (uae)
Date: Sat, 6 Mar 2010 23:32:00 +0400 (uae)
From: root@hphost25
Message-Id: <201003061932.o26JW0V14578@hphost25>
Subject: cron

Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
stty: : Not a typewriter
age is the standard output
and standard error of one of your crontab commands:

/cardprod/batches/LiveSync.sh>>/cardprod/batches/logs/ProcessFiles.log &
------------------------------
Deeos
Regular Advisor

Re: Cron Job issue

hi can you share me ?
script: /cardprod/batches/LiveSync.sh>>/cardprod/batches/logs/ProcessFiles.log &
Deepak
Dennis Handly
Acclaimed Contributor

Re: Cron Job issue

>What is the issue with the profile? Earlier the same script was working fine.

Did you redirect stderr as I mentioned?
. ~/.profile > /dev/null 2>&1

If your script isn't moving the files, change the "#!" line to add "-x" to the end. This will trace execution and may give an idea where it fails.
Steven Schweda
Honored Contributor

Re: Cron Job issue

> A search for keywords like, say,
> cron stty
> [...]

I tried Google with:

cron stty "Not a typewriter"

and found (among many):

http://muzso.hu/2007/08/06/fixing-stty-errors-during-crontab-scripts-on-hp-ux

which looked reasonable.
V.P
Frequent Advisor

Re: Cron Job issue

Dear All,

Issue resolved. Above mentioned file is calling a configuration file for the details. In that IP mentioned was wrong. We have changed the same.

Once again thanks....