<?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: Seeking crontab solution in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238279#M173218</link>
    <description>Todd has it.&lt;BR /&gt;&lt;BR /&gt;Set in cron an entry to run every day at the correct start time.&lt;BR /&gt;In the script check if day of week is Sun or Wed and also check from a flag file if it is 14 days since last run time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;at the end of script if it is run then touch a flag file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
    <pubDate>Fri, 02 Apr 2004 11:05:13 GMT</pubDate>
    <dc:creator>Paula J Frazer-Campbell</dc:creator>
    <dc:date>2004-04-02T11:05:13Z</dc:date>
    <item>
      <title>Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238273#M173212</link>
      <description>I need to schedule two shell scripts to run in the cron scheduler every two weeks on a sunday evening and every two weeks on a wednesday.  I know that a can schedule the jobs for the first and fifteenth day of the month, however this is not what I need.  The scripts need to run every 14 days to coincide with a payroll cycle.  I may be overlooking the obvious solution, but I can't seem to find a workable answer.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any assistance.</description>
      <pubDate>Fri, 02 Apr 2004 10:50:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238273#M173212</guid>
      <dc:creator>ROBIN METZLER</dc:creator>
      <dc:date>2004-04-02T10:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238274#M173213</link>
      <description>Why not schedule the two scripts sunday and wednesday - day of the week column - and make the script check for the last run, for instance with a flag file or the last log.&lt;BR /&gt;&lt;BR /&gt;Have you consider using the at command ?</description>
      <pubDate>Fri, 02 Apr 2004 10:56:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238274#M173213</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-02T10:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238275#M173214</link>
      <description>Sounds like a great candidate for a script to be run at boot as a startup script.&lt;BR /&gt;&lt;BR /&gt;I believe cron would be too convoluted a way to do it, since it could be any Sunday and any Wednesday from month to month.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just modify your scripts to check a 14 day interval then check the day of the week to be sure it is the correct day.&lt;BR /&gt;&lt;BR /&gt;Or you can hardcode it to check the Julian date.</description>
      <pubDate>Fri, 02 Apr 2004 11:01:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238275#M173214</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2004-04-02T11:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238276#M173215</link>
      <description>Check out Clay's datehammer:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cmve.net/~merijn/#Contrib" target="_blank"&gt;http://www.cmve.net/~merijn/#Contrib&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Though the link seems to be down at the moment...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Apr 2004 11:02:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238276#M173215</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-04-02T11:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238277#M173216</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Link to Clays script:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=371092" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=371092&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Gideon&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Apr 2004 11:04:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238277#M173216</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2004-04-02T11:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238278#M173217</link>
      <description>The key to doing what you want is to put some smarts inside your cron'ed script to determine if this is the payroll week. Your respective cron jobs should run every Wednesday and every Sunday.&lt;BR /&gt;&lt;BR /&gt;The key to this is caljd.sh; with no arguments it will return the current Julian Day (number of days since 4712 BCE). You divide that by 7 to get the week and then a mod 2 will yield 1 or 0 to get you every other week.&lt;BR /&gt;&lt;BR /&gt;In your cron'ed script or cron'ed wrapper script do this:&lt;BR /&gt;&lt;BR /&gt;payroll_wk()&lt;BR /&gt;{&lt;BR /&gt;  typeset -i10 WK=$((($(caljd.sh) + 1) / 7))&lt;BR /&gt;  typeset -i10 WK2=$((${WK} % 2))&lt;BR /&gt;  return ${WK2}&lt;BR /&gt;} # payroll_wk&lt;BR /&gt;&lt;BR /&gt;typeset -i10 THIS_WK=$(payroll_wk)&lt;BR /&gt;if [[ ${THIS_WK} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Do it"&lt;BR /&gt;else&lt;BR /&gt;  echo "Don't; exit"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;You may need to change the logic so that if 1 you do it and also note that $(caljd.sh) + 1 is used so that the new week starts on Sun. Becuase of this, your "Sunday" logic will probably be different from your "Wednesday" logic.&lt;BR /&gt;&lt;BR /&gt;Invoke as caljd.sh -u for full usage and examples.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Apr 2004 11:05:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238278#M173217</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-02T11:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238279#M173218</link>
      <description>Todd has it.&lt;BR /&gt;&lt;BR /&gt;Set in cron an entry to run every day at the correct start time.&lt;BR /&gt;In the script check if day of week is Sun or Wed and also check from a flag file if it is 14 days since last run time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;at the end of script if it is run then touch a flag file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Fri, 02 Apr 2004 11:05:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238279#M173218</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2004-04-02T11:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking crontab solution</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238280#M173219</link>
      <description>Thanks to everyone for your input.  This has rejunvinated my creative juices to solve an apparently simple task.  &lt;BR /&gt;&lt;BR /&gt;Thanks for your time.  I appreciate it.</description>
      <pubDate>Fri, 02 Apr 2004 11:47:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/seeking-crontab-solution/m-p/3238280#M173219</guid>
      <dc:creator>ROBIN METZLER</dc:creator>
      <dc:date>2004-04-02T11:47:54Z</dc:date>
    </item>
  </channel>
</rss>

