<?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 script not work .. tried everything!! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615076#M37331</link>
    <description>The script runs as root. What does the telnet do that the cron wont do?? I have no idea maybe this app only works a certain way.&lt;BR /&gt;&lt;BR /&gt;Richard</description>
    <pubDate>Fri, 16 Nov 2001 16:13:54 GMT</pubDate>
    <dc:creator>someone_4</dc:creator>
    <dc:date>2001-11-16T16:13:54Z</dc:date>
    <item>
      <title>cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615066#M37321</link>
      <description>Hey everyone &lt;BR /&gt;I have attached a file with 3 ways I have tried to run a script for a 3rd party app from our software vendor. The app is called swmaint. The issue is that we can only run this command on our maintance window because it brings down our whole system.Let me break down what is going on per script.&lt;BR /&gt;&lt;BR /&gt;Script1:&lt;BR /&gt;It works thoguh cron the command line and though remsh shell. And this is what we wanna do!! &lt;BR /&gt;&lt;BR /&gt;script2:&lt;BR /&gt;works though command line. But not though cron. &lt;BR /&gt;&lt;BR /&gt;script3:&lt;BR /&gt;works though command line but not though cron. &lt;BR /&gt;&lt;BR /&gt;script4:&lt;BR /&gt;works though command line but not though cron&lt;BR /&gt;&lt;BR /&gt;does anyone have any ideas?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Nov 2001 00:08:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615066#M37321</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-11-16T00:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615067#M37322</link>
      <description>Also is it safe to telnet to local host?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Fri, 16 Nov 2001 00:19:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615067#M37322</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-11-16T00:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615068#M37323</link>
      <description>Okay Richard, it appears that you have your PATH set. That is the most common error when using cron. However, I suspect that you missed the second most common error: not trapping for interactive commands in a non-interactive environment (i.e. cron). This explains why it works perfectly from the shell and not from cron. It is almost always a bad idea to source a .profile in a cron script. Most .profile's have terminal setup stuff like tabs and tset. This will hang when stdin or stdout is not a tty device. &lt;BR /&gt;&lt;BR /&gt;Possible Fix 1)&lt;BR /&gt;surround everything that may be looking for a terminal with&lt;BR /&gt;if [ -t 0 -o -t 1 ]&lt;BR /&gt;  then&lt;BR /&gt;    terminal command here&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;-t 0 (stdin) -t 1 (stdout)&lt;BR /&gt;&lt;BR /&gt;Possible Fix 2 (better answer))&lt;BR /&gt;Have a config file which sets the stuff your need in a separate which must not have an exit statement. Then both your cron script and your .profile can source this file.&lt;BR /&gt;&lt;BR /&gt;This still may not be enough. You may need to use an exec statement to redirect stdin, stdout, and/or stderr.</description>
      <pubDate>Fri, 16 Nov 2001 00:20:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615068#M37323</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-11-16T00:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615069#M37324</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;You would be logged in as root when you submit the job to cron, right?&lt;BR /&gt;&lt;BR /&gt;After cron triggers script 3, does the file /eteam/reconfig/reconf.log&lt;BR /&gt;contain "reconfig started" ?</description>
      <pubDate>Fri, 16 Nov 2001 01:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615069#M37324</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-16T01:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615070#M37325</link>
      <description>Yes the log shows that it did start.&lt;BR /&gt;&lt;BR /&gt;richard</description>
      <pubDate>Fri, 16 Nov 2001 01:39:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615070#M37325</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-11-16T01:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615071#M37326</link>
      <description>Could you try putting some more echo statements around the calls to swmaint, just to see where it is getting stuck?&lt;BR /&gt;&lt;BR /&gt;Also, if you redirect the stdout &amp;amp; stderr to the same log file, it should be helpful. I'd hate to see a '/usr/sbin/ unreadable ' message in the logfile! :)</description>
      <pubDate>Fri, 16 Nov 2001 03:21:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615071#M37326</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-16T03:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615072#M37327</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;Put on some loggin and source your .profile (cd . ./home/username/.profile)&lt;BR /&gt;check out the results.&lt;BR /&gt;&lt;BR /&gt;Gideon</description>
      <pubDate>Fri, 16 Nov 2001 08:30:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615072#M37327</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2001-11-16T08:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615073#M37328</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;check interactively, if your command works when TERM is not set (I had this with ADABAS D database tools).&lt;BR /&gt;&lt;BR /&gt;Script 1 sets TERM !&lt;BR /&gt;&lt;BR /&gt;Script 2 sets TERM, but excutes .profile afterwards, and maybe resets it (swap the lines and check) !&lt;BR /&gt;&lt;BR /&gt;Script 3 and 4 do not set TERM !&lt;BR /&gt;&lt;BR /&gt;That is the most obvious diffrence I found.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;Volker</description>
      <pubDate>Fri, 16 Nov 2001 09:56:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615073#M37328</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-11-16T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615074#M37329</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;In all scripts don't set term variable, set it in /.profile only and execute . /.profile in all scripts. I feel it will work bcos as soon as u r executing . /.profile previous settings of TERM variable are resetting.&lt;BR /&gt;&lt;BR /&gt;And also recheck ur cron entries.&lt;BR /&gt;&lt;BR /&gt;Cheers...&lt;BR /&gt;Satish.</description>
      <pubDate>Fri, 16 Nov 2001 13:20:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615074#M37329</guid>
      <dc:creator>Satish Y</dc:creator>
      <dc:date>2001-11-16T13:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615075#M37330</link>
      <description>Does the script run as root? or another user?&lt;BR /&gt;&lt;BR /&gt;Also it looks like some path settings need to be added to the script. Cron doesn't always source in .profile or .cshrc&lt;BR /&gt;&lt;BR /&gt;Another thing could be that the scripts needs to write out to a device so maybe add &amp;gt; /dev/null or something like that.</description>
      <pubDate>Fri, 16 Nov 2001 13:59:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615075#M37330</guid>
      <dc:creator>Krishna Prasad</dc:creator>
      <dc:date>2001-11-16T13:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615076#M37331</link>
      <description>The script runs as root. What does the telnet do that the cron wont do?? I have no idea maybe this app only works a certain way.&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Fri, 16 Nov 2001 16:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615076#M37331</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-11-16T16:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615077#M37332</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;I suspect a env var is the cause.  Try this:&lt;BR /&gt;&lt;BR /&gt;I the script, redirect you environment to see what is different from the shell and the cron.&lt;BR /&gt;&lt;BR /&gt;Something like&lt;BR /&gt;&lt;BR /&gt;env &amp;gt; /tmp/script2_cron_env.txt&lt;BR /&gt;&lt;BR /&gt;Then run it from the cron.&lt;BR /&gt;&lt;BR /&gt;Then change it to read&lt;BR /&gt;&lt;BR /&gt;env &amp;gt; /tmp/script2_shell_env.txt&lt;BR /&gt;&lt;BR /&gt;Then run it from command line.&lt;BR /&gt;&lt;BR /&gt;Look and see what the differences are????&lt;BR /&gt;&lt;BR /&gt;I bet you will find your answer.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you can run it from the command line, you can run it from the cron.&lt;BR /&gt;&lt;BR /&gt;...jcd...&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Nov 2001 19:24:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615077#M37332</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-11-16T19:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: cron script not work .. tried everything!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615078#M37333</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;most definitely something in your environment is different from cron. Remember cron has a very limited number of environment variables set. full pathnames should always be used. Someone suggested doing a cron job to output what the "env" variables are, and then do an "env" in your login to see what the differences are, especially the PATH (order counts).&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Fri, 16 Nov 2001 19:44:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-script-not-work-tried-everything/m-p/2615078#M37333</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-11-16T19:44:14Z</dc:date>
    </item>
  </channel>
</rss>

