<?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: Perl Problem in Cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343989#M869628</link>
    <description>you can simpy copy PATH from your .profile to shell script which is in crontab.&lt;BR /&gt;copy PATH from env&lt;BR /&gt;&lt;BR /&gt;In crontab you have to allways setup path for everything. You you have output/input log config files they all have to be defined.&lt;BR /&gt;like this in example.&lt;BR /&gt;&lt;BR /&gt;/u01/app/oracle/product/8.0.6/bin/sqlldr user/pass control=/dir/foo logfile=/dir/log</description>
    <pubDate>Thu, 29 Jul 2004 02:42:16 GMT</pubDate>
    <dc:creator>Petr Simik_1</dc:creator>
    <dc:date>2004-07-29T02:42:16Z</dc:date>
    <item>
      <title>Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343985#M869624</link>
      <description>Hi Everybody,&lt;BR /&gt;&lt;BR /&gt;I've been solving this problem for days now and still i can't make it work. I have perl script that load data in our database. In the command line, i can successfully run my perl script via shell script. But, when i try to do it via cron then problem begins....&lt;BR /&gt;&lt;BR /&gt;This is what i'm getting:&lt;BR /&gt;&lt;BR /&gt;Can't exec "sqlldr": No such file or directory&lt;BR /&gt;&lt;BR /&gt;I read this is caused by not properly setting the ENV.&lt;BR /&gt;&lt;BR /&gt;How can i set my ENV right?&lt;BR /&gt;Do i need to add additional lines in my script? in shell? in perl? or in cron?&lt;BR /&gt;&lt;BR /&gt;Pls. i need your help.&lt;BR /&gt;&lt;BR /&gt;If my problem is already been discussed i would gladly apprciate if you post the thread link..&lt;BR /&gt;&lt;BR /&gt;Thanks...</description>
      <pubDate>Wed, 28 Jul 2004 21:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343985#M869624</guid>
      <dc:creator>Allan_40</dc:creator>
      <dc:date>2004-07-28T21:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343986#M869625</link>
      <description>You MUST explicitly set your path within your script.  Either fully qualify the path to the sqlldr command or export your PATH within the script.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2004 21:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343986#M869625</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-07-28T21:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343987#M869626</link>
      <description>Hi Patrick,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply.&lt;BR /&gt;&lt;BR /&gt;Yes i read a lot of thread saying that i should include the PATH or ENV...but, how can i do it? should i do it i my perl script? or shell?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 28 Jul 2004 21:57:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343987#M869626</guid>
      <dc:creator>Allan_40</dc:creator>
      <dc:date>2004-07-28T21:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343988#M869627</link>
      <description>All scripts, whether shell or Perl, etc must have *all* the variables set as required by your script. If you login and type this command:&lt;BR /&gt; &lt;BR /&gt;export PATH=&lt;BR /&gt; &lt;BR /&gt;Now you'll find that all Unix commands and programs cannot be found. When put commands like cut and awk and grep in a script, they can't be found unless the PATH crutch is available. So many sysadmins have forgotten about PATH that they don't really know where the command is located. Now change PATH to:&lt;BR /&gt; &lt;BR /&gt;export PATH=/usr/bin&lt;BR /&gt; &lt;BR /&gt;and now vi and grep and awk can be found. PATH is one of dozens of environment variables in your 'normal' login. cron does not login so it does not inherit any of these values. So restore your basic PATH value by typing:&lt;BR /&gt; &lt;BR /&gt;export PATH=$(cat /etc/PATH)&lt;BR /&gt; &lt;BR /&gt;Now to see your login environment, type the commands: set and env. The set command shows everything, env shows just the exported values. You can capture the env output and add it to your script. But the better way is to examine your script to see what it (and commands that you use in the script) needs. Then code those into your script.</description>
      <pubDate>Wed, 28 Jul 2004 22:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343988#M869627</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-07-28T22:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343989#M869628</link>
      <description>you can simpy copy PATH from your .profile to shell script which is in crontab.&lt;BR /&gt;copy PATH from env&lt;BR /&gt;&lt;BR /&gt;In crontab you have to allways setup path for everything. You you have output/input log config files they all have to be defined.&lt;BR /&gt;like this in example.&lt;BR /&gt;&lt;BR /&gt;/u01/app/oracle/product/8.0.6/bin/sqlldr user/pass control=/dir/foo logfile=/dir/log</description>
      <pubDate>Thu, 29 Jul 2004 02:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343989#M869628</guid>
      <dc:creator>Petr Simik_1</dc:creator>
      <dc:date>2004-07-29T02:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343990#M869629</link>
      <description>an example :&lt;BR /&gt;I do not have . in my PATH.&lt;BR /&gt;&lt;BR /&gt;$ ln -s /bin/ls ls_in_home_dir&lt;BR /&gt;$ perl&lt;BR /&gt;system("ls_in_home_dir");&lt;BR /&gt;&lt;BR /&gt;Nothing happens (system call doesn't work cause not finding the program). Now I put . in PATH using ENV:&lt;BR /&gt;&lt;BR /&gt;$ perl&lt;BR /&gt;$ENV{'PATH'}.=":.";&lt;BR /&gt;system("ls_in_home_dir");&lt;BR /&gt;bin&lt;BR /&gt;docs&lt;BR /&gt;log&lt;BR /&gt;ls_in_home_dir&lt;BR /&gt;scripts&lt;BR /&gt;&lt;BR /&gt;That's all :)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2004 03:58:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343990#M869629</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-29T03:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343991#M869630</link>
      <description>Hi to everybody...&lt;BR /&gt;&lt;BR /&gt;I'd like to thank you all for your quick reply...&lt;BR /&gt;&lt;BR /&gt;I already fixed the problem...finally!!&lt;BR /&gt;&lt;BR /&gt;I just added these lines in my perl script&lt;BR /&gt;&lt;BR /&gt;$ENV{ORACLE_BASE}='/oracle';&lt;BR /&gt;$ENV{ORACLE_SID}='cdsdbdev';&lt;BR /&gt;$ENV{ORACLE_HOME}='/oracle/app/product/10.1.0.2/db'; &lt;BR /&gt;&lt;BR /&gt;Thank you all!!!!</description>
      <pubDate>Thu, 29 Jul 2004 04:04:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343991#M869630</guid>
      <dc:creator>Allan_40</dc:creator>
      <dc:date>2004-07-29T04:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Problem in Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343992#M869631</link>
      <description>Just a style point that you may want to consider......&lt;BR /&gt;&lt;BR /&gt;I have a script called ora_defaults that sets up the oracle environment. I source it at the beginning of all my scripts so that I know the environment is set up correctly.&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;. /home/oracle/ora_defaults&lt;BR /&gt;&lt;THE rest="" of="" the="" script=""&gt;&lt;/THE&gt;&lt;BR /&gt;This saves you should your oracle home, oracle_sid, etc. should change.&lt;BR /&gt;&lt;BR /&gt;BTW - Good name Allan&lt;BR /&gt;-Good Luck &lt;BR /&gt; Allan Hicks</description>
      <pubDate>Mon, 02 Aug 2004 08:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-problem-in-cron/m-p/3343992#M869631</guid>
      <dc:creator>R. Allan Hicks</dc:creator>
      <dc:date>2004-08-02T08:28:15Z</dc:date>
    </item>
  </channel>
</rss>

