<?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: Regular command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475673#M212525</link>
    <description>You asked cron to run your command every 15 minutes, not 10 minutes.&lt;BR /&gt;&lt;BR /&gt;The warning is only applicable if&lt;BR /&gt;&lt;BR /&gt;(a) you don't have a #!/bin/ksh or something at the start of your file&lt;BR /&gt;&lt;BR /&gt;(b) running your script using sh is a problem&lt;BR /&gt;&lt;BR /&gt;Otherwise, ignore it.&lt;BR /&gt;&lt;BR /&gt;Did you really mean to do&lt;BR /&gt;&lt;BR /&gt;. /opt/OV/bin/pingcheck&lt;BR /&gt;&lt;BR /&gt;i.e. was the '.' deliberate?&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Feb 2005 08:55:18 GMT</pubDate>
    <dc:creator>Stephen Keane</dc:creator>
    <dc:date>2005-02-01T08:55:18Z</dc:date>
    <item>
      <title>Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475672#M212524</link>
      <description>Dear all,&lt;BR /&gt;i need to run a script every 10 min, every day to do a specific job&lt;BR /&gt;can someone tell me how to write it in crontab, also how to check the the job runs ?&lt;BR /&gt;&lt;BR /&gt;i did the following, is it right ??&lt;BR /&gt;&lt;BR /&gt;00,15,30,45 * * * * ./opt/OV/bin/pingcheck&lt;BR /&gt;&lt;BR /&gt;:q&lt;BR /&gt;warning: commands will be executed using /usr/bin/sh&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;also this warning i got when i quit the crontab -e root   what does it mean ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Tue, 01 Feb 2005 08:47:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475672#M212524</guid>
      <dc:creator>Ahmed_41</dc:creator>
      <dc:date>2005-02-01T08:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475673#M212525</link>
      <description>You asked cron to run your command every 15 minutes, not 10 minutes.&lt;BR /&gt;&lt;BR /&gt;The warning is only applicable if&lt;BR /&gt;&lt;BR /&gt;(a) you don't have a #!/bin/ksh or something at the start of your file&lt;BR /&gt;&lt;BR /&gt;(b) running your script using sh is a problem&lt;BR /&gt;&lt;BR /&gt;Otherwise, ignore it.&lt;BR /&gt;&lt;BR /&gt;Did you really mean to do&lt;BR /&gt;&lt;BR /&gt;. /opt/OV/bin/pingcheck&lt;BR /&gt;&lt;BR /&gt;i.e. was the '.' deliberate?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 08:55:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475673#M212525</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-02-01T08:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475674#M212526</link>
      <description>Ahmed&lt;BR /&gt;&lt;BR /&gt;Your format is correct.  Check /var/adm/cron/log for messages regarding job start/stop.  You may also want to re-direct any STDERR/STDOUT to /dev/null to prevent the script output creating mail:&lt;BR /&gt;&lt;BR /&gt;00,15,30,45 * * * * ./opt/OV/bin/pingcheck 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Any script specified will be run using the /usr/bin/sh shell (unless you include an alternative in your script).&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
      <pubDate>Tue, 01 Feb 2005 08:56:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475674#M212526</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-02-01T08:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475675#M212527</link>
      <description>Ahmed,&lt;BR /&gt;your crontab entry is correct to run every 15 minutes. The warning can be ignored unless your pingcheck script relies on a specific shell.&lt;BR /&gt;The warning just means that the shell used will be /usr/bin/sh.&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 01 Feb 2005 08:56:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475675#M212527</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-02-01T08:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475676#M212528</link>
      <description>yes my script starts by&lt;BR /&gt;#! /bin/sh&lt;BR /&gt;&lt;BR /&gt;and i am using the ./ cuz when i run my script from a shell i need to  do ./script name&lt;BR /&gt;&lt;BR /&gt;so is there any problem with that ?? i mean is there a problem to call my script using the ./ since i do the same when i try to call it from the shell&lt;BR /&gt;&lt;BR /&gt;do you think i shall change the script to start by #! /bin/ksh    and why ??? &lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 09:00:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475676#M212528</guid>
      <dc:creator>Ahmed_41</dc:creator>
      <dc:date>2005-02-01T09:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475677#M212529</link>
      <description>Hi,&lt;BR /&gt;the warning means that your crontab file does not have a line specifying which shell to use, e.g.&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;you should not start the path to the program with a dot:&lt;BR /&gt;./opt/OV/bin/pingcheck&lt;BR /&gt;should probably be&lt;BR /&gt;/opt/OV/bin/pingcheck&lt;BR /&gt;and I would recommend that you redirect output to a file, which can then be checked for errors, e.g.:&lt;BR /&gt;&lt;BR /&gt;0,10,20,30,40,50 * * * * /opt/OV/bin/pingcheck &amp;gt;/tmp/pingcheck.out 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;You should also consider editing your crontab in a separate file, and when  satisfied with the file, activate it by executing:&lt;BR /&gt;# crontab &lt;FILE&gt;&lt;BR /&gt;to read it in as the current users crontab, but check first with the id command which user you are!&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 01 Feb 2005 09:03:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475677#M212529</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-02-01T09:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475678#M212530</link>
      <description>here is the log&lt;BR /&gt;i cannot understand did it run or not&lt;BR /&gt;&lt;BR /&gt;# cd /var/adm/cron&lt;BR /&gt;# more log&lt;BR /&gt;! *** cron started ***   pid = 1082 Tue Feb  1 14:49:06 CAT 2005&lt;BR /&gt;&amp;gt;  CMD: ./opt/OV/bin/pingcheck&lt;BR /&gt;&amp;gt;  root 2690 c Tue Feb  1 15:15:00 CAT 2005&lt;BR /&gt;&amp;lt;  root 2690 c Tue Feb  1 15:15:03 CAT 2005&lt;BR /&gt;&amp;gt;  CMD: ./opt/OV/bin/pingcheck&lt;BR /&gt;&amp;gt;  root 2728 c Tue Feb  1 15:30:00 CAT 2005&lt;BR /&gt;&amp;lt;  root 2728 c Tue Feb  1 15:30:13 CAT 2005 rc=127&lt;BR /&gt;&amp;gt;  CMD: ./opt/OV/bin/pingcheck&lt;BR /&gt;&amp;gt;  root 2781 c Tue Feb  1 15:45:00 CAT 2005&lt;BR /&gt;&amp;lt;  root 2781 c Tue Feb  1 15:45:13 CAT 2005 rc=127&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;besdie i am sure it didnot run, cuz if it run it calls another script that do some changes which didnot happen</description>
      <pubDate>Tue, 01 Feb 2005 09:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475678#M212530</guid>
      <dc:creator>Ahmed_41</dc:creator>
      <dc:date>2005-02-01T09:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475679#M212531</link>
      <description>No, your script almost certainly did not run.  The rc=127 is the key.  That is a error return code.&lt;BR /&gt;&lt;BR /&gt;rc=127  can't fork (this might also be return code from the shell)&lt;BR /&gt;&lt;BR /&gt;Your problem almost certainly is the fact that you have a ./ in front of the command.  That will not work.  If you command is located in /opt/OV/bin, then just take the . off.  If your command is located somewhere else, specify the FULLY QUALIFIED path to the command.&lt;BR /&gt;&lt;BR /&gt;If you want it to run every 10 mintutes it should be:&lt;BR /&gt;&lt;BR /&gt;00,10,20,30,40,50 * * * * /opt/OV/bin/pingcheck</description>
      <pubDate>Tue, 01 Feb 2005 09:14:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475679#M212531</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-02-01T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475680#M212532</link>
      <description>Looking at the log, the first run took 3 seconds.  Both subsequent runs took 13 seconds, but returned a non-zero exit code (check the script).  Cron has run the job though.&lt;BR /&gt;&lt;BR /&gt;After each log job entry, a PID is given with a start time on the next line.  The PID is then repeated later in the log when the job finishes, with the completion time (with the &amp;gt; &amp;lt; signs showing start or completion).&lt;BR /&gt;&lt;BR /&gt;Keith</description>
      <pubDate>Tue, 01 Feb 2005 09:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475680#M212532</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-02-01T09:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475681#M212533</link>
      <description>You don't want to use ./ in any crontab entry. cron does not login and therefore, any of your environment (shell variables, ulimit values, etc) are not inherited. Read the man page for crontab where it discusses the cron environment.&lt;BR /&gt; &lt;BR /&gt;Now the reason tht you have to type ./anything is that the full path to your script in not in your current $PATH variable, and that's a good thing, especially for home diretories. But in your pingcheck task, the full path is already present and does not need the leading .&lt;BR /&gt; &lt;BR /&gt;Now if you cannot type just /opt/OV/bin/pingcheck (no leading .) to start pingcheck then somehow, you have the /opt directory in your home directory...very strange. The only login where this would work is if you are logged in as root and your home is / (which isn't a good idea anyway) or you are logged in as a normal user and / is your home (never a good idea). Is /opt mounted from another computer? I would never recommend that for a production system. &lt;BR /&gt; &lt;BR /&gt;The /bin/sh is fine and should be left that way. ksh and sh (the POSIX shell in HP-UX only) are virtually the same. If the script runs OK, just leave the shell command line as it is. NOTE: /bin is not a directory on HP-UX. The correct path is /usr/bin, as it is on many other flavors of SysV Unix. It was changed more than 10 years ago. /bin works because it is a symbolic link, or more accurately, a transition link, designed to make the transition to the V.4 filesystem layout a bit easier.&lt;BR /&gt; &lt;BR /&gt;To see if your cron job runs OK, insert the line: set -x as the second line in your script. When it runs, the entire script will be traced and the output sent to your email address on the HP-UX computer.</description>
      <pubDate>Tue, 01 Feb 2005 09:17:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475681#M212533</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-02-01T09:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475682#M212534</link>
      <description>guys,&lt;BR /&gt;i did the change i removed the "." and i changed the interval to the one i need&lt;BR /&gt;&lt;BR /&gt;but it is still not working, i get the same things in the log&lt;BR /&gt;i would like to mention that this script calls another script from inside it, should i remove also the "." from infront the other script i am calling from inside the main script ??&lt;BR /&gt;&lt;BR /&gt;Thank</description>
      <pubDate>Tue, 01 Feb 2005 09:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475682#M212534</guid>
      <dc:creator>Ahmed_41</dc:creator>
      <dc:date>2005-02-01T09:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475683#M212535</link>
      <description>Hi,&lt;BR /&gt;you should of course test your command directly on the command line before entering it in crontab.&lt;BR /&gt;If the command does not function as expected in crontab - and if you have not redirected command output to a file - then check the mail for the user in question.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 01 Feb 2005 09:41:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475683#M212535</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-02-01T09:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regular command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475684#M212536</link>
      <description>Yes, absolutely!  You don't want any './' if you are calling scripts within scripts UNLESS you cd to the appropriate directory first.  The best way, though, is to just use fully qualified paths to call scripts and commands.</description>
      <pubDate>Tue, 01 Feb 2005 10:24:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-command/m-p/3475684#M212536</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-02-01T10:24:57Z</dc:date>
    </item>
  </channel>
</rss>

