<?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: Schedule file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337688#M874409</link>
    <description>Search the forum for date hammer.&lt;BR /&gt;This utility is by A Clay.&lt;BR /&gt;&lt;BR /&gt;This is how to go about your cron entry.&lt;BR /&gt;&lt;BR /&gt;The script will run every thursday and friday. Will update a status file with date. Nest thursday/friday, it will check when was it run last time and if time difference is 14 days, execute it, else not.&lt;BR /&gt;&lt;BR /&gt;This is the logic, I would recommand you to use. And will require some good scripting to be done. But it will be a lot easier with the caljd.sh(date hammer)&lt;BR /&gt;&lt;BR /&gt;Anil</description>
    <pubDate>Wed, 21 Jul 2004 11:33:57 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2004-07-21T11:33:57Z</dc:date>
    <item>
      <title>Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337687#M874408</link>
      <description>I have a process script which needs to run every "other Thursday,Friday", I need to schedule the job .&lt;BR /&gt;&lt;BR /&gt;Please share your thoughts, idea ..</description>
      <pubDate>Wed, 21 Jul 2004 11:28:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337687#M874408</guid>
      <dc:creator>la_cool</dc:creator>
      <dc:date>2004-07-21T11:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337688#M874409</link>
      <description>Search the forum for date hammer.&lt;BR /&gt;This utility is by A Clay.&lt;BR /&gt;&lt;BR /&gt;This is how to go about your cron entry.&lt;BR /&gt;&lt;BR /&gt;The script will run every thursday and friday. Will update a status file with date. Nest thursday/friday, it will check when was it run last time and if time difference is 14 days, execute it, else not.&lt;BR /&gt;&lt;BR /&gt;This is the logic, I would recommand you to use. And will require some good scripting to be done. But it will be a lot easier with the caljd.sh(date hammer)&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 21 Jul 2004 11:33:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337688#M874409</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-07-21T11:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337689#M874410</link>
      <description>Its called cron&lt;BR /&gt;&lt;BR /&gt;The sysadmin's servert/slave/lackey&lt;BR /&gt;&lt;BR /&gt;crontab -l&lt;BR /&gt;&lt;BR /&gt;displays the current schedule&lt;BR /&gt;&lt;BR /&gt;crontab -e lets you edit it&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://search.hp.com/redirect.html?url=http%3A//forums1.itrc.hp.com/service/forums/questionanswer.do%3FthreadId%3D137999&amp;amp;qt=cron+%2Bconfiguration&amp;amp;hit=4" target="_blank"&gt;http://search.hp.com/redirect.html?url=http%3A//forums1.itrc.hp.com/service/forums/questionanswer.do%3FthreadId%3D137999&amp;amp;qt=cron+%2Bconfiguration&amp;amp;hit=4&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you are actually working on a server and not studying for a test, I recommend HP's Sysadmin I course.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/pdf/B2355-90781docs.pdf" target="_blank"&gt;http://docs.hp.com/hpux/pdf/B2355-90781docs.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2004 11:37:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337689#M874410</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-07-21T11:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337690#M874411</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking for the script that can run every other Thursday and friday.&lt;BR /&gt;&lt;BR /&gt;I 'd like to know how do I set in the "cronjob or at command".</description>
      <pubDate>Wed, 21 Jul 2004 14:11:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337690#M874411</guid>
      <dc:creator>la_cool</dc:creator>
      <dc:date>2004-07-21T14:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337691#M874412</link>
      <description>You CAN'T simply use cron; it's not that smart but what you can do is run a command EVERY Thursday and Friday and then let the command itself figure out if this is an even or odd week and run only on the even weeks otherwise it simply exits. Note: Cron has an intentionally sparse environment including PATH so generally the first thing a script has to do is set and export PATH:&lt;BR /&gt;&lt;BR /&gt;You need to download and install the attached caljd.sh script; among other things, it can return the number of days since Jan 1, 4712 BCE; divide that number by 7 and you get a week number; mod that by 2 and you get 0 or 1. Invoke as caljd.sh -u for full usage and examples.&lt;BR /&gt;&lt;BR /&gt;Your crontab entry should look like this:&lt;BR /&gt;&lt;BR /&gt;0 6 * * * 4,5 /root/bin/myscript.sh&lt;BR /&gt;&lt;BR /&gt;Run at 0600 each Thursday and Friday.&lt;BR /&gt;&lt;BR /&gt;Your myscript.sh should look something like this (assuming that you have insatlled caljd.sh in /usr/local/bin):&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;export PATH=${PATH}:/usr/bin:/use/local/bin&lt;BR /&gt;STAT=0&lt;BR /&gt;if [[ $(( (($(caljd.sh) - 1) / 7) % 2 )) -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Do your thing"&lt;BR /&gt;fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;Note the "$(caljd.sh) - 1" that is done because Julian Day 1 fell on a Monday and weeks are generally considered to start on Sunday. You may want to change the "-eq 0" to&lt;BR /&gt;"-eq 1" depending on which week you actually want to start. Unlike using the week number from the date command, caljd.sh will continue to work whether or not the year has 52 or 53 weeks (or parts thereof) in it.&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2004 15:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337691#M874412</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-07-21T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337692#M874413</link>
      <description>You can do this using sam.&lt;BR /&gt; &lt;BR /&gt;# sam -&amp;gt; Process Management -&amp;gt; Scheduled Cron Jobs -&amp;gt; Action -&amp;gt; Add&lt;BR /&gt;&lt;BR /&gt;This is easy way to set scheduling job.</description>
      <pubDate>Wed, 21 Jul 2004 20:24:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schedule-file/m-p/3337692#M874413</guid>
      <dc:creator>YoungHwan, Ko</dc:creator>
      <dc:date>2004-07-21T20:24:51Z</dc:date>
    </item>
  </channel>
</rss>

