<?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: Upload data every nine weeks? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896682#M820140</link>
    <description>Cron on its own ain't gonna do this but we can easily run your script every Monday at 0800 and simply exit if this ain't the week.&lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PATH=${PATH}:/usr/local/bin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;typeset -i WK=$(( (($(caljd.sh) + 1) / 7) % 9 ))&lt;BR /&gt;if [[ ${WK} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Run Your Script"&lt;BR /&gt;else&lt;BR /&gt;  echo "Do nothing"&lt;BR /&gt;  exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;The + 1 offset is used to make the weeks start on Sunday. We then divide by 7 to get the week number and then a mod 9. You may need to change the -eq 0 to some other value between 0 and 8 to do correct week. The advantage of this method is that it is going to work year-in, year-out without any changes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 04 Feb 2003 20:03:37 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2003-02-04T20:03:37Z</dc:date>
    <item>
      <title>Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896679#M820137</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a requirement to automatically upload some data files to a remote server every 9 weeks (on a Monday at 8 AM) . I can't find a combination of crontab entries that will do this.  I haven't wriitten the upload script but my problem now is simply getting cron to run anything on a  nine-week interval.&lt;BR /&gt;&lt;BR /&gt;Any ideas out there?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your time,&lt;BR /&gt;Neil</description>
      <pubDate>Tue, 04 Feb 2003 19:56:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896679#M820137</guid>
      <dc:creator>Neil Edwards</dc:creator>
      <dc:date>2003-02-04T19:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896680#M820138</link>
      <description>You might want to take a look at 'at' to do the scheduling.&lt;BR /&gt;&lt;BR /&gt;Once you run it the first time you could schedule it via 'at' to run again in 63 days.&lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;at now + 63 days &amp;lt; /dir/script_to_run</description>
      <pubDate>Tue, 04 Feb 2003 20:00:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896680#M820138</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-02-04T20:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896681#M820139</link>
      <description>See John Poff's solution using at in this thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xce7187dc4d7dd5118ff00090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xce7187dc4d7dd5118ff00090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 04 Feb 2003 20:00:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896681#M820139</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-02-04T20:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896682#M820140</link>
      <description>Cron on its own ain't gonna do this but we can easily run your script every Monday at 0800 and simply exit if this ain't the week.&lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PATH=${PATH}:/usr/local/bin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;typeset -i WK=$(( (($(caljd.sh) + 1) / 7) % 9 ))&lt;BR /&gt;if [[ ${WK} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Run Your Script"&lt;BR /&gt;else&lt;BR /&gt;  echo "Do nothing"&lt;BR /&gt;  exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;The + 1 offset is used to make the weeks start on Sunday. We then divide by 7 to get the week number and then a mod 9. You may need to change the -eq 0 to some other value between 0 and 8 to do correct week. The advantage of this method is that it is going to work year-in, year-out without any changes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Feb 2003 20:03:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896682#M820140</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-02-04T20:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896683#M820141</link>
      <description>Ooops, I suppose I better attach caljd.sh, I typically install it in /usr/local/bin.&lt;BR /&gt;&lt;BR /&gt;No points for this, please.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Feb 2003 20:07:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896683#M820141</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-02-04T20:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896684#M820142</link>
      <description>Hi guys and thanks for your answers. Clay's response made me realize that I could simply use `date '%U`   % 9 to do the same thing and much easier. I will assign points to all.&lt;BR /&gt;&lt;BR /&gt;Thanks again, &lt;BR /&gt;Neil&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Feb 2003 20:23:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896684#M820142</guid>
      <dc:creator>Neil Edwards</dc:creator>
      <dc:date>2003-02-04T20:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Upload data every nine weeks?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896685#M820143</link>
      <description>Sorry Neil, date '+%U' will almost work and you won't know you have problems until the year changes (and some will work just fine). If the year starts on a Sunday, the week number is 1 but otherwise the week number of the days before the 1st Sunday is zero. Caljd.sh counts days sequentially from 4713BCE and avoids this problem.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Feb 2003 20:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/upload-data-every-nine-weeks/m-p/2896685#M820143</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-02-04T20:29:50Z</dc:date>
    </item>
  </channel>
</rss>

