<?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: cron error in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824619#M781369</link>
    <description>Elif,&lt;BR /&gt;&lt;BR /&gt;Remember that when something runs from cron, the environment is very sparse. There is little, or no, PATH environment which is the usual cause of problems.&lt;BR /&gt;&lt;BR /&gt;~/spot/startmap.log:&lt;BR /&gt;&lt;BR /&gt;use the full PATH to the log file, cron does not know what user this is, or set the PATH variables in the beginning of your cron script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
    <pubDate>Mon, 17 Jul 2006 05:05:33 GMT</pubDate>
    <dc:creator>Robert-Jan Goossens</dc:creator>
    <dc:date>2006-07-17T05:05:33Z</dc:date>
    <item>
      <title>cron error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824617#M781367</link>
      <description>It has been my impression for some time now that any scripts written to &lt;BR /&gt;be CRONned has to be sh shell scripts, like so;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;If the script is based on a shell other than sh, e.g. C shell or Korn &lt;BR /&gt;shell, then the appropriate CRON entry should be&lt;BR /&gt;&lt;BR /&gt;* * * * * /usr/bin/ksh &lt;KORN shell="" script=""&gt;&lt;/KORN&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;* * * * * /usr/bin/csh &lt;C shell="" script=""&gt;&lt;/C&gt;&lt;BR /&gt;and not simply&lt;BR /&gt;&lt;BR /&gt;* * * * * &lt;KORN shell="" script=""&gt;&lt;/KORN&gt;&lt;BR /&gt;This is because the CRON daemon simply shells the scripts using sh and does not actually fork a seperate shell script process to run the script.&lt;BR /&gt;&lt;BR /&gt;Because I get an error like "sh: ~/spot/startmap.log: cannot create&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;Am I wrong?</description>
      <pubDate>Mon, 17 Jul 2006 04:59:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824617#M781367</guid>
      <dc:creator>Elif Gius</dc:creator>
      <dc:date>2006-07-17T04:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: cron error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824618#M781368</link>
      <description>I've never heard that. I've got several examples of&lt;BR /&gt;&lt;BR /&gt;* * * * * &lt;KORN shell="" script=""&gt;&lt;/KORN&gt;&lt;BR /&gt;which work fine.&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Mon, 17 Jul 2006 05:03:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824618#M781368</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2006-07-17T05:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: cron error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824619#M781369</link>
      <description>Elif,&lt;BR /&gt;&lt;BR /&gt;Remember that when something runs from cron, the environment is very sparse. There is little, or no, PATH environment which is the usual cause of problems.&lt;BR /&gt;&lt;BR /&gt;~/spot/startmap.log:&lt;BR /&gt;&lt;BR /&gt;use the full PATH to the log file, cron does not know what user this is, or set the PATH variables in the beginning of your cron script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Mon, 17 Jul 2006 05:05:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824619#M781369</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2006-07-17T05:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: cron error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824620#M781370</link>
      <description>Hi Elif,&lt;BR /&gt;cron runs in a basic environment with very little defined.&lt;BR /&gt;I always recommend my users run their scripts in a test environment, that has /bin/sh as the shell and litte in the .profile (just as cron will execute the commands).&lt;BR /&gt;&lt;BR /&gt;If you need any environment variables other than the basics ($HOME etc), then run a "setenv" style script that sets up the PATH, ORACLE_SID etc variables.&lt;BR /&gt;&lt;BR /&gt;Also, *ALWAYS* give the full path for all commands in scripts, don't assume that programs such as echo, tar etc will be the correct echos and tars.&lt;BR /&gt;&lt;BR /&gt;I had a user who (when they typed echo) used /usr/bin/echo in their interactive shell, but when they ran their script from cron, it came up with the shell built-in.&lt;BR /&gt;And similarly when somebody had several versions of tar in different areas(/opt/bin/tar, /bin/tar). Then gnu tar was added to /usr/local/bin/tar - all of a sudden, the script that called "tar" failed to behave as expected, as /usr/local/bin was first in the PATH.&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jul 2006 06:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824620#M781370</guid>
      <dc:creator>Mancboy</dc:creator>
      <dc:date>2006-07-17T06:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: cron error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824621#M781371</link>
      <description>Elif,&lt;BR /&gt;&lt;BR /&gt;Sorry if I'm stating the obvious, but check that '~/spot/startmap.log' is what you want, and not '~spot/startmap.log'.&lt;BR /&gt;&lt;BR /&gt;As others have said, check that your environmental variables are set up properly.  If you're looking to test variables from cron, create a script that echos the variables in question, and read the output.  For a more generic approach, you could put environmental variables in a file, and source that file from scripts you run as cron or other users.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Mon, 17 Jul 2006 06:43:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-error/m-p/3824621#M781371</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-17T06:43:39Z</dc:date>
    </item>
  </channel>
</rss>

