RE: crontab and exec

RE: crontab and exec

 

  

I can echo, echo, and it will go to the file as follows:

Echo "Here I go " >> /u01/file.lis

Then,
Exec 1>${file} 2>&1

Echo "Here I don't go " >> /u01/file.lis

It is as simple as that. I even sourced echo...
ECHO=/bin/echo

$ECHO "Here I don't go " >> /u01/file.lis

This only doesn't work when executing the script from cron.



-----Original Message-----
From: Chris Hagemaier
[mailto:oracledba-ezmlmshield-x72175287.[Email address protected]
Sent: Thursday, December 29, 2005 3:59 PM
To: LazyDBA Discussion
Subject: RE: crontab and exec

Joel-
Is ${file} part of your environment or to you pass it to the script?
Just a thought but consider that cron jobs execute without an
environment. For example $PATH doesn't exist.

-----Original Message-----
From: Patterson Joel
[mailto:oracledba-ezmlmshield-x30363202.[Email address protected]
Sent: Thursday, December 29, 2005 12:51 PM
To: LazyDBA Discussion
Subject: crontab and exec




I'm having a heck of a time with cron on WBEL (linux). (sysadmin being
twirp) -- teaching me sysadmin by letting me figure it out myself, (ie
lazy)... except I don't want to be a sysadmin... nuf of that).

1) Some of you may recall my "exec 1>${file} 1>&2" line of code I use
in my scripts... I am attempting to solve my original riddle (which I
won't go into here), by running my script now via cron. What used to
work does not seem to correctly, at least on this box.

I cannot get any statement after the 'exec' to echo anywhere IF the
script is called from cron. (It works otherwise).

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

2) ALSO. cron is runnig on EST, and my 'date' displays GMT... (I want
cron to run on GMT time as well.

More /etc/sysconfig/clock
ZONE="Europe/London"
UTC=true
ARC=false

Other server have different settings. Where do I go from here?
Something is missing as 'normal' sysadmins have already set up such
things for me and my scripts 'normally' work.


Thanks


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html



--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Douglas County, Oregon
www.co.douglas.or.us



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html



Oracle LazyDBA home page