From: Ralf Borowski <rborowski () tembec ! ca>
To: tru64-unix-managers
Subject: Cron problem executing csh script
Date: Wed, 03 Apr 2002 18:17:51 +0000 [thread overview]
Message-ID: <102653755322185.tru64-unix-managers.marc@archive.invalid> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------=_NextPart_000_0001_01C1DB11.F62632B0", Size: 12919 bytes --]
This is a multi-part message in MIME format.
------=_NextPart_000_0001_01C1DB11.F62632B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hello,
I'm running Tru64 5.1A with the aggregate patch kit loaded and have some
odd behavior with cron. I have a csh script designed to put oracle table
spaces into backup mode. When I log in as oracle and run the script,
all works ok. When the script is run via the oracle account's crontab
entry, it seems as if only the first line of the script executes.
The crontab entry was created using crontab -e when logged in as the
oracle user. The entry is:
20 09 * * * /bin/csh
/usr/tembec/oracle817/backup_scripts/build_archive_scripts.csh
The entry seems to be firing as scheduled.
The script is owned by oracle, and has permissions set to 755 as do the
*.scr scripts that are used as input for svrmgrl and sqlplus.
Here is the script:
touch last_runtime >> /usr/tembec/oracle817/backup_scripts/logfile
#
setenv ORACLE_SID rcs51 >> /usr/tembec/oracle817/backup_scripts/logfile
cd /usr/tembec/oracle817/backup_scripts/rcs51
sqlplus < ../build_archive_scripts.scr
svrmgrl < turn_archiving_on.scr
The first line (touch .) was added simply to determine if cron was
running the job. The output redirection was added to try to capture an
error message, but the logfile is always empty after the script is run
from cron.
Thanks in advance for any help you can provide.
Regards,
Ralf
Ralf Borowski
Senior Systems Specialist
Tembec Inc. - Pulp Group
Tel. (819) 627-4103
Fax. (819) 627-9908
rborowski@tembec.ca
------=_NextPart_000_0001_01C1DB11.F62632B0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C1DB11.F4EE7600">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-compose;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */=20
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I’m running Tru64 5.1A with the aggregate patch =
kit
loaded and have some odd behavior with <span class=3DSpellE>cron</span>. =
I have a
<span class=3DSpellE>csh</span> script designed to put oracle table =
spaces into backup
mode.<span style=3D'mso-spacerun:yes'> </span>When I log in as =
oracle and run
the script, all works ok.<span style=3D'mso-spacerun:yes'> =
</span>When the
script is run via the oracle account’s <span =
class=3DSpellE>crontab</span>
entry, it seems as if only the first line of the script =
executes.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The <span class=3DSpellE>crontab</span> entry was =
created
using <span class=3DSpellE>crontab</span> –e when logged in as the =
oracle
user.<span style=3D'mso-spacerun:yes'> </span>The entry =
is:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>20 09 * * * /bin/<span =
class=3DSpellE>csh</span>
/usr/tembec/oracle817/backup_scripts/build_archive_scripts.csh<o:p></o:p>=
</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The entry seems to be firing as =
scheduled.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The script is owned by oracle, and has permissions =
set to
755 as do the *.<span class=3DSpellE>scr</span> scripts that are used as =
input
for <span class=3DSpellE>svrmgrl</span> and <span =
class=3DSpellE>sqlplus</span>.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Here is the script:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
class=3DGramE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>touch</span></font></span><f=
ont
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>last_runtime</span> >>
/usr/tembec/oracle817/backup_scripts/logfile<o:p></o:p></span></font></p>=
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>#<o:p></o:p></span></font></=
p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>setenv</span></font></span></span><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> ORACLE_SID rcs51<span
style=3D'mso-spacerun:yes'> </span>>>
/usr/tembec/oracle817/backup_scripts/logfile<o:p></o:p></span></font></p>=
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>cd</span></font></span></span><font size=3D2 face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> =
/usr/tembec/oracle817/backup_scripts/rcs51
<o:p></o:p></span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>sqlplus</span></font></span></span><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> < ../<span =
class=3DSpellE>build_archive_scripts.scr</span><o:p></o:p></span></font><=
/p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>svrmgrl</span></font></span></span><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> < <span =
class=3DSpellE>turn_archiving_on.scr</span><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The first line (touch …) was added simply to =
determine
if <span class=3DSpellE>cron</span> was running the job. <span
style=3D'mso-spacerun:yes'> </span>The output redirection was added =
to try
to capture an error message, but the <span class=3DSpellE>logfile</span> =
is
always empty after the script is run from =
cron.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks in advance for any help you can =
provide.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Regards,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Ralf<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoAutoSig><i style=3D'mso-bidi-font-style:normal'><font =
size=3D3
face=3DVerdana><span =
style=3D'font-size:12.0pt;font-family:Verdana;font-style:italic;
mso-bidi-font-style:normal;mso-no-proof:yes'>Ralf =
Borowski<o:p></o:p></span></font></i></p>
<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial;mso-no-proof:yes'>Senior Systems =
Specialist<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial;mso-no-proof:yes'>Tembec Inc. - Pulp =
Group<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial;mso-no-proof:yes'>Tel. (819) =
627-4103<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial;mso-no-proof:yes'>Fax. (819) =
627-9908<o:p></o:p></span></font></p>
<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial;mso-no-proof:yes'>rborowski@tembec.ca<o:p></o:p></span>=
</font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
------=_NextPart_000_0001_01C1DB11.F62632B0--
reply other threads:[~2002-04-03 18:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox