<?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: Issue on Cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775415#M390375</link>
    <description>help in what then.&lt;BR /&gt;&lt;BR /&gt;you cron script check_perform_action, runs every minute, &lt;BR /&gt;&lt;BR /&gt;if the script perform_action exists &lt;BR /&gt;&lt;BR /&gt;runs it, waits for 10 seconds after run is complete and then deletes it&lt;BR /&gt;&lt;BR /&gt;then exits&lt;BR /&gt;&lt;BR /&gt;if the script perform_action does not exist at the time check_perform_action, you are out of luck. check_perform_action exits without doing anything&lt;BR /&gt;&lt;BR /&gt;I think you want something like that as your check_perform_action.sh script&lt;BR /&gt;&lt;BR /&gt;s=1&lt;BR /&gt;while [ $s -le 58 ] &lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [ -e /home/glance/Perform_Action.sh ]&lt;BR /&gt;then&lt;BR /&gt;./Perform_Action.sh&lt;BR /&gt;sleep 10&lt;BR /&gt;rm -rf Perform_Action.sh&lt;BR /&gt;exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;(( s=$s+1 )) &lt;BR /&gt;sleep 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is not a bullet proof script but it runs in a way close to how you want it to run&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Apr 2011 14:08:46 GMT</pubDate>
    <dc:creator>Mel Burslan</dc:creator>
    <dc:date>2011-04-08T14:08:46Z</dc:date>
    <item>
      <title>Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775412#M390372</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need a script to be executed every second. So, I have scheduled that in cron. But I found its not getting executed.&lt;BR /&gt;&lt;BR /&gt;This is my crontab entry.&lt;BR /&gt;&lt;BR /&gt;* * * * * sh /home/glance/Check_Perform_Action.sh&lt;BR /&gt;&lt;BR /&gt;The content of Check_Perform_Action.sh&lt;BR /&gt;is below.&lt;BR /&gt;if [ -e /home/glance/Perform_Action.sh ]&lt;BR /&gt;then&lt;BR /&gt;./Perform_Action.sh&lt;BR /&gt;sleep 10&lt;BR /&gt;rm -rf Perform_Action.sh&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When the Perform_Action.sh executed, a file has to be generated. Thats the content of that file.&lt;BR /&gt;&lt;BR /&gt;Kindly help.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance!!!</description>
      <pubDate>Fri, 08 Apr 2011 13:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775412#M390372</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-04-08T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775413#M390373</link>
      <description>first thing : cron is granular to 1 minute not at seconds level. Your cron entry tells it to run every minute not second.&lt;BR /&gt;&lt;BR /&gt;second thing: if some other script/program is not generating the Perform_Action.sh script, and you are deleting it on the line just before the last, how do you expect it to run again, 10 seconds later ?</description>
      <pubDate>Fri, 08 Apr 2011 13:48:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775413#M390373</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-04-08T13:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775414#M390374</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to run the Perform_Action.sh Script when it is found in the specified path.&lt;BR /&gt;So, I need a script to check whether the Perform_Action.sh script is present or not. If it exist, then it should run the Perform_Action.sh.&lt;BR /&gt;&lt;BR /&gt;Thanks!!</description>
      <pubDate>Fri, 08 Apr 2011 13:53:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775414#M390374</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-04-08T13:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775415#M390375</link>
      <description>help in what then.&lt;BR /&gt;&lt;BR /&gt;you cron script check_perform_action, runs every minute, &lt;BR /&gt;&lt;BR /&gt;if the script perform_action exists &lt;BR /&gt;&lt;BR /&gt;runs it, waits for 10 seconds after run is complete and then deletes it&lt;BR /&gt;&lt;BR /&gt;then exits&lt;BR /&gt;&lt;BR /&gt;if the script perform_action does not exist at the time check_perform_action, you are out of luck. check_perform_action exits without doing anything&lt;BR /&gt;&lt;BR /&gt;I think you want something like that as your check_perform_action.sh script&lt;BR /&gt;&lt;BR /&gt;s=1&lt;BR /&gt;while [ $s -le 58 ] &lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [ -e /home/glance/Perform_Action.sh ]&lt;BR /&gt;then&lt;BR /&gt;./Perform_Action.sh&lt;BR /&gt;sleep 10&lt;BR /&gt;rm -rf Perform_Action.sh&lt;BR /&gt;exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;(( s=$s+1 )) &lt;BR /&gt;sleep 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is not a bullet proof script but it runs in a way close to how you want it to run&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Apr 2011 14:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775415#M390375</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-04-08T14:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775416#M390376</link>
      <description>If you want it to run that often, why don't you just let it run forever and put a sleep command in to give it a little time between checks.  That way you don't have to mess with cron.&lt;BR /&gt;&lt;BR /&gt;Rick</description>
      <pubDate>Fri, 08 Apr 2011 14:19:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775416#M390376</guid>
      <dc:creator>RickT_1</dc:creator>
      <dc:date>2011-04-08T14:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775417#M390377</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;When I run the Check_Perform_Action.sh manually, I am not facing any issue. The Perform_Action.sh is executed properly and I am getting the desired output. Only when I schedule it through cron, I am facing issue.&lt;BR /&gt;&lt;BR /&gt;This is my Perform_Action.sh:&lt;BR /&gt;&lt;BR /&gt;i=`hostname`&lt;BR /&gt;bdf &amp;gt;&amp;gt; /home/glance/Action_Performed_$i&lt;BR /&gt;&lt;BR /&gt;Thanks!!!</description>
      <pubDate>Fri, 08 Apr 2011 14:25:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775417#M390377</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-04-08T14:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue on Cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775418#M390378</link>
      <description>What issue ??&lt;BR /&gt;I explained how your script works. &lt;BR /&gt;you have a wrong assumption:&lt;BR /&gt;your Check script thru cron will only run once every minute and if yout action script is there it will run it once and exit. If it is not there, it will exit without doing anything.&lt;BR /&gt;&lt;BR /&gt;under the circumstances, what issue are you talking about ? you want something from this script but you are not telling it how to do it. Do you know the famous saying "Computers do what you TELL them to do, NOT what you WANT them to do" ? It is famous for a reason.&lt;BR /&gt;&lt;BR /&gt;I gave you a rough example how to accomplish it above or you can do as Rick says and leave the cron stuff aside and leave the script running all the time with 1 second sleep intervals.&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Apr 2011 14:30:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-on-cron/m-p/4775418#M390378</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-04-08T14:30:16Z</dc:date>
    </item>
  </channel>
</rss>

