<?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 every 2 mins in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974871#M293496</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can run the script every minute, but to put into the script the following:&lt;BR /&gt;&lt;BR /&gt;typeset -i N=0&lt;BR /&gt;N=$(date +%m)%2&lt;BR /&gt;if [ $N -ne 0 ]; then&lt;BR /&gt; exit&lt;BR /&gt;fi&lt;BR /&gt;#Your script etc&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;</description>
    <pubDate>Wed, 04 Apr 2007 02:31:08 GMT</pubDate>
    <dc:creator>Victor Fridyev</dc:creator>
    <dc:date>2007-04-04T02:31:08Z</dc:date>
    <item>
      <title>Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974867#M293492</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Sorry to ask a basic question. How can we run cron every 2 mins? Should list such 2,4,6,8,etc * * * *? Is there any better way?&lt;BR /&gt;&lt;BR /&gt;Pls help. &lt;BR /&gt;Thanks and Best regards,&lt;BR /&gt;Negara</description>
      <pubDate>Tue, 03 Apr 2007 22:39:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974867#M293492</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2007-04-03T22:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974868#M293493</link>
      <description>That's the way it is done. Some flavors of "improved" UNIX allow more flexibility but stick with the standard syntax and your crontab entries will work everywhere. Now have you considered what happens if for some reason the previous cron job is still running when the new one fires off?</description>
      <pubDate>Tue, 03 Apr 2007 23:00:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974868#M293493</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-03T23:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974869#M293494</link>
      <description>To run every 2 minutes, yes you need to list ALL even (or odd) numbered minutes.&lt;BR /&gt;&lt;BR /&gt;Another way to do it would be via 'at'.  At the end of your script you do an 'at scriptname now + 2 minutes' 'man at' for more information.&lt;BR /&gt;&lt;BR /&gt;# cat script&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;do stuff&lt;BR /&gt;do more stuff&lt;BR /&gt;do even more stuff&lt;BR /&gt;at /dir/script now +2 minutes&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Apr 2007 23:01:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974869#M293494</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-04-03T23:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974870#M293495</link>
      <description>hi Negara,&lt;BR /&gt;&lt;BR /&gt;the most easy and dull way to do it is:&lt;BR /&gt;#***************************************&lt;BR /&gt;00 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;02 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;04 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;06 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;..&lt;BR /&gt;50 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;52 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;54 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;56 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;58 * * * *  /home/yogeeraj/myscript.sh&lt;BR /&gt;#***************************************&lt;BR /&gt;# min|hour |day  |month|day  |script&lt;BR /&gt;#    |     |of mo|     |of wk|&lt;BR /&gt;#----|-----|-----|-----|-----|-----------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 04 Apr 2007 00:29:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974870#M293495</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-04T00:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974871#M293496</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can run the script every minute, but to put into the script the following:&lt;BR /&gt;&lt;BR /&gt;typeset -i N=0&lt;BR /&gt;N=$(date +%m)%2&lt;BR /&gt;if [ $N -ne 0 ]; then&lt;BR /&gt; exit&lt;BR /&gt;fi&lt;BR /&gt;#Your script etc&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Apr 2007 02:31:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974871#M293496</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2007-04-04T02:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974872#M293497</link>
      <description>Oops, sorry&lt;BR /&gt;&lt;BR /&gt;There is a mistake in date format. &lt;BR /&gt;&lt;BR /&gt;typeset -i N=0&lt;BR /&gt;N=$(date +%M)%2&lt;BR /&gt;if [ $N -ne 0 ]; then&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;According to the condition the script will exit every odd minute and will work every even minute.&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Wed, 04 Apr 2007 03:22:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974872#M293497</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2007-04-04T03:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974873#M293498</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you have to setup your cronjob every minute, but can prepend a one-liner to skip the add minute:&lt;BR /&gt;* * * * * [ $(date '+\%M 2\%\%p' | dc) -eq 1 ] || /path/2your/your-cron-script&lt;BR /&gt;&lt;BR /&gt;The above construct will NOT have an exit status != 0 for skipped minutes.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 04 Apr 2007 06:00:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974873#M293498</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-04-04T06:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974874#M293499</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;It looks fine to me now. Thanks alot for all your help. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Negara</description>
      <pubDate>Wed, 04 Apr 2007 21:57:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974874#M293499</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2007-04-04T21:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cron every 2 mins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974875#M293500</link>
      <description>Change in your script so that it runs in alternate minute and run that script once every hour.</description>
      <pubDate>Wed, 04 Apr 2007 23:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-every-2-mins/m-p/3974875#M293500</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2007-04-04T23:06:45Z</dc:date>
    </item>
  </channel>
</rss>

