<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: crontab erroring out with rc=1 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841206#M273341</link>
    <description>Let's add some additional debugging. Add a -x in the shell invocation line:&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash -x&lt;BR /&gt;&lt;BR /&gt;And redirect all output to a separate log file. e.g.:&lt;BR /&gt;&lt;BR /&gt;30 * * * * . /data/vision/scripts/test.sh &amp;gt; /tmp/test.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;What is in /tmp/test.log after that runs?</description>
    <pubDate>Thu, 10 Aug 2006 09:39:56 GMT</pubDate>
    <dc:creator>Jonathan Fife</dc:creator>
    <dc:date>2006-08-10T09:39:56Z</dc:date>
    <item>
      <title>crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841194#M273329</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to run script through crontab but it is throwing following error.&lt;BR /&gt;&lt;BR /&gt;CMD: . /data/vision/scripts/test.sh&amp;gt;&amp;gt;/data/vision/scripts/test.log&lt;BR /&gt;vision 13619 c Thu Aug 10 18:10:00 IST 2006&lt;BR /&gt;vision 13619 c Thu Aug 10 18:10:00 IST 2006 rc=1&lt;BR /&gt;------------&lt;BR /&gt;extract from cron.allow file&lt;BR /&gt;root&lt;BR /&gt;adm&lt;BR /&gt;uucp&lt;BR /&gt;applcrp1&lt;BR /&gt;vision&lt;BR /&gt;-------------&lt;BR /&gt;there is no cron.deny file&lt;BR /&gt;&lt;BR /&gt;I am able to run the script from the command prompt.&lt;BR /&gt;&lt;BR /&gt;Enclosed is the script.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Siddharth&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2006 09:00:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841194#M273329</guid>
      <dc:creator>siddharthC</dc:creator>
      <dc:date>2006-08-10T09:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841195#M273330</link>
      <description>what's the syntax in the crontab? Hope U've given the absolute path of the script in crontab !&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2006 09:04:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841195#M273330</guid>
      <dc:creator>Pupil_1</dc:creator>
      <dc:date>2006-08-10T09:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841196#M273331</link>
      <description>Hi Siddharth,&lt;BR /&gt;&lt;BR /&gt;Remember that a cron job has a very sparse environment. You should source the env vars you need for this script to run. And don't just run the .profile for that user unless you're sure that there are no routines that need a tty to execute.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 10 Aug 2006 09:04:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841196#M273331</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2006-08-10T09:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841197#M273332</link>
      <description>You have made the classic error for any cron'ed job and that is to assume that when you run a command under cron as a certain user (e.g. oracle) that you also inherit that user's normal environment. The environment under cron is intentionally very sparse. You must explicitly set and export PATH and any other needed environemt variables such as ORACLE_HOME and ORACLE_SID. Normally these assignments and exports are done very early in your cron'ed script.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2006 09:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841197#M273332</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-10T09:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841198#M273333</link>
      <description>I suspect that it is not a problem with cron but rather a problem with the script.  I was unable to open your attachment, but the usual problems with cron executed scripts are with the environment.  The cron environment is intentionally sparse (see man crontab), so you need to make sure to use all full path names  and not assume that any environment variables are set.  One way to do this is to source an environment script at the beginning of your script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 10 Aug 2006 09:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841198#M273333</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-08-10T09:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841199#M273334</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please take into account that crontab does not give to running scripts full environment, including PATH.&lt;BR /&gt;You have either in beginning of the script to execiute:&lt;BR /&gt;. ~/.profile , which is preferable&lt;BR /&gt;or to use full paths in each command.&lt;BR /&gt;&lt;BR /&gt;Usually all cron scripts problems are connected to lack of environment.&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 10 Aug 2006 09:06:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841199#M273334</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2006-08-10T09:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841200#M273335</link>
      <description>Is anything added to test.log? &lt;BR /&gt;&lt;BR /&gt;Are you setting your ORACLE_SID in some wrapper script or within the cron line?</description>
      <pubDate>Thu, 10 Aug 2006 09:10:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841200#M273335</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-08-10T09:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841201#M273336</link>
      <description>I have given the following syntax for scheduling the job&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;30 * * * * . /data/vision/scripts/cp_arc_remote_loc_ver04.sh&amp;gt;&amp;gt;archive.log</description>
      <pubDate>Thu, 10 Aug 2006 09:11:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841201#M273336</guid>
      <dc:creator>siddharthC</dc:creator>
      <dc:date>2006-08-10T09:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841202#M273337</link>
      <description>Try changing the crontab entry as follows.&lt;BR /&gt;&lt;BR /&gt;30 * * * * /data/vision/scripts/cp_arc_remote_loc_ver04.sh&amp;gt;&amp;gt;/tmp/archive.log&lt;BR /&gt;&lt;BR /&gt;Assuming that the absolute path of the cp_arc_remote_loc_ver04.sh script is /data/vision/scripts/ !!</description>
      <pubDate>Thu, 10 Aug 2006 09:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841202#M273337</guid>
      <dc:creator>Pupil_1</dc:creator>
      <dc:date>2006-08-10T09:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841203#M273338</link>
      <description>Might be worth replacing the '30' with a smaller value to check it sooner than the 30 mins !!&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2006 09:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841203#M273338</guid>
      <dc:creator>Pupil_1</dc:creator>
      <dc:date>2006-08-10T09:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841204#M273339</link>
      <description>I have sourced the required environment but still getting the same error.</description>
      <pubDate>Thu, 10 Aug 2006 09:26:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841204#M273339</guid>
      <dc:creator>siddharthC</dc:creator>
      <dc:date>2006-08-10T09:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841205#M273340</link>
      <description>Don't recall the "bash" syntax, but there should be something along the lines of "set -x" that will cause each command to echo prior to execution. &lt;BR /&gt;&lt;BR /&gt;Try that and see if it will tell you which command is failing.&lt;BR /&gt;&lt;BR /&gt;Its almost got to be either a path issue, or possibly something from the .bashrc file that needs to be set up in the script for it to run</description>
      <pubDate>Thu, 10 Aug 2006 09:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841205#M273340</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-08-10T09:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841206#M273341</link>
      <description>Let's add some additional debugging. Add a -x in the shell invocation line:&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash -x&lt;BR /&gt;&lt;BR /&gt;And redirect all output to a separate log file. e.g.:&lt;BR /&gt;&lt;BR /&gt;30 * * * * . /data/vision/scripts/test.sh &amp;gt; /tmp/test.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;What is in /tmp/test.log after that runs?</description>
      <pubDate>Thu, 10 Aug 2006 09:39:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841206#M273341</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-08-10T09:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841207#M273342</link>
      <description>Sourcing .profile may not work because almost certainly the .profile has commands like tput, tset, tabs, ... which expect stdin to a tty device so you would have to&lt;BR /&gt;surround those commands with something like &lt;BR /&gt;if [ -t 0 ]&lt;BR /&gt;  then&lt;BR /&gt;    tput&lt;BR /&gt;    ...&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;or better still have your cron'ed script and .profile source a file which sets and exports the needed environment variables.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2006 10:45:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841207#M273342</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-10T10:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: crontab erroring out with rc=1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841208#M273343</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I have tried including the .profile and environment. Still no sucess. Enclosed is the debug file.</description>
      <pubDate>Fri, 11 Aug 2006 04:37:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-erroring-out-with-rc-1/m-p/3841208#M273343</guid>
      <dc:creator>siddharthC</dc:creator>
      <dc:date>2006-08-11T04:37:43Z</dc:date>
    </item>
  </channel>
</rss>

