<?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: Monthly cronjobs in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596310#M375417</link>
    <description>here is a much simpler method, you can get the last day of the current month like this:&lt;BR /&gt;&lt;BR /&gt;# echo `cal` | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;this is today:&lt;BR /&gt;&lt;BR /&gt;# date +'%d'&lt;BR /&gt;&lt;BR /&gt;to evaluate if today is the last day of the month:&lt;BR /&gt;&lt;BR /&gt;# [[ $(date +'%d') -eq $(echo `cal` | awk '{print $NF}') ]]&lt;BR /&gt;&lt;BR /&gt;you can concatenate this to your cronjob and run it every day:&lt;BR /&gt;&lt;BR /&gt;00 23 * * * [[ $(date +'%d') -eq $(echo `cal` | awk '{print $NF}') ]] &amp;amp;&amp;amp; /root/GEN_REPORT.sh&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 08 Mar 2010 14:55:14 GMT</pubDate>
    <dc:creator>Viktor Balogh</dc:creator>
    <dc:date>2010-03-08T14:55:14Z</dc:date>
    <item>
      <title>Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596304#M375411</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Field descriptions of a crontab file say, 3rd field (Range 1-31). But, if I have to schedule a job to run every month end for a year starting Jan, how do i do that.&lt;BR /&gt;&lt;BR /&gt;Pls suggest</description>
      <pubDate>Sun, 07 Mar 2010 17:07:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596304#M375411</guid>
      <dc:creator>arkie</dc:creator>
      <dc:date>2010-03-07T17:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596305#M375412</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The definition of "month end" might differ from the actual last day of a month.  If is doesn't and its the actual last day that you want to run on, let your script determine if it should exit or continue.&lt;BR /&gt;&lt;BR /&gt;One way for your script to decide if its execution is on the last day of any month is something like this, exiting if it isn't time:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;MONEND=$(cal $(date "+%m %Y")|awk '/[1-3]/ {DAY=$NF};END{print DAY}')&lt;BR /&gt;[ $(date "+%d") -ne  ${MONEND} ] &amp;amp;&amp;amp; exit&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Mar 2010 17:33:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596305#M375412</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-07T17:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596306#M375413</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;While it should be obvious from my initial remarks, given that it's the last day of any month that your script should run, I'd 'cron' it for the appropriate time something like this:&lt;BR /&gt;&lt;BR /&gt;0 1 28,29,30,31 * * /path_toscript&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 07 Mar 2010 22:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596306#M375413</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-07T22:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596307#M375414</link>
      <description>Other than JRF's solution, could you convince management that 12:00 am on the first of the month is just as good?</description>
      <pubDate>Mon, 08 Mar 2010 03:05:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596307#M375414</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-08T03:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596308#M375415</link>
      <description>Hi JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for these great ways of doing things.&lt;BR /&gt;&lt;BR /&gt;Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;We tried to convince the mgmt, our job could be easier, but they'r strict about having the getting the reports on the last day of every month.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 08 Mar 2010 05:17:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596308#M375415</guid>
      <dc:creator>arkie</dc:creator>
      <dc:date>2010-03-08T05:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596309#M375416</link>
      <description>What if you ran the report for the previous month in the first minute of the first day of the following month? You can't get much more "month end" than 11:59:59.9999 (plus 1 second) on the last day of each month.&lt;BR /&gt;&lt;BR /&gt;0 0 1 * * script</description>
      <pubDate>Mon, 08 Mar 2010 13:31:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596309#M375416</guid>
      <dc:creator>mvpel</dc:creator>
      <dc:date>2010-03-08T13:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596310#M375417</link>
      <description>here is a much simpler method, you can get the last day of the current month like this:&lt;BR /&gt;&lt;BR /&gt;# echo `cal` | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;this is today:&lt;BR /&gt;&lt;BR /&gt;# date +'%d'&lt;BR /&gt;&lt;BR /&gt;to evaluate if today is the last day of the month:&lt;BR /&gt;&lt;BR /&gt;# [[ $(date +'%d') -eq $(echo `cal` | awk '{print $NF}') ]]&lt;BR /&gt;&lt;BR /&gt;you can concatenate this to your cronjob and run it every day:&lt;BR /&gt;&lt;BR /&gt;00 23 * * * [[ $(date +'%d') -eq $(echo `cal` | awk '{print $NF}') ]] &amp;amp;&amp;amp; /root/GEN_REPORT.sh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Mar 2010 14:55:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596310#M375417</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2010-03-08T14:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596311#M375418</link>
      <description>I found this also, it's a pretty simple method:&lt;BR /&gt;&lt;BR /&gt;# [[ $(cal) = *$(date +%d) ]]&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1158441" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1158441&lt;/A&gt;</description>
      <pubDate>Mon, 08 Mar 2010 15:00:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596311#M375418</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2010-03-08T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly cronjobs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596312#M375419</link>
      <description>&amp;gt;mvpel: What if you ran the report for the previous month in the first minute of the first day of the following month?&lt;BR /&gt;&lt;BR /&gt;Didn't I already suggest that?  :-)</description>
      <pubDate>Mon, 08 Mar 2010 20:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monthly-cronjobs/m-p/4596312#M375419</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-08T20:32:05Z</dc:date>
    </item>
  </channel>
</rss>

