<?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: Easter Date? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739199#M101346</link>
    <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;You could cron something like this:&lt;BR /&gt;&lt;BR /&gt;0 8 3,10 4 1 mailx -s "Easter is April 16" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Look at the manpages for 'crontab(1)'.  The line above generates a mail to "root" with the message "Easter is April 16" on April 3 and April 10 (Mondays) at 0800.&lt;BR /&gt;&lt;BR /&gt;Add that line to your root crontab or create a root crontab with 'vi'.&lt;BR /&gt;&lt;BR /&gt;I like to do:&lt;BR /&gt;&lt;BR /&gt;# crontab -l &amp;gt; /tmp/mycrontab&lt;BR /&gt;[ edit ]&lt;BR /&gt;# crontab /tmp/mycrontab&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 02 Mar 2006 15:25:18 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-03-02T15:25:18Z</dc:date>
    <item>
      <title>Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739190#M101337</link>
      <description>Hi experts,&lt;BR /&gt;&lt;BR /&gt;We always schedule maintenance over the Easter Sunday weekend. Is there a method to automatically calculate this date? I just can't seem to find any relationship between the date from year to year.&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;Ryan&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2006 15:44:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739190#M101337</guid>
      <dc:creator>Ryan Clerk</dc:creator>
      <dc:date>2006-02-24T15:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739191#M101338</link>
      <description>Go to &lt;A href="http://www.perl.org/CPAN" target="_blank"&gt;www.perl.org/CPAN&lt;/A&gt; and search on easter. You will find plenty of methods. Easter date calculations are far from trivial. C. F. Gauss (the dude for whom the&lt;BR /&gt;magnetic field strength unit is named) devised an algoritm. I wrote a shell script based on his algorithm many years ago. I may be able to find it but I know there are Perl modules for this.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2006 15:47:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739191#M101338</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-24T15:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739192#M101339</link>
      <description>This should get you started.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://search.cpan.org/search?query=Easter&amp;amp;mode=all" target="_blank"&gt;http://search.cpan.org/search?query=Easter&amp;amp;mode=all&lt;/A&gt;</description>
      <pubDate>Fri, 24 Feb 2006 15:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739192#M101339</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-24T15:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739193#M101340</link>
      <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;This will compute the date for you:&lt;BR /&gt;&lt;BR /&gt;# cat ./easter&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use Date::Calc qw(Easter_Sunday);&lt;BR /&gt;my ($year,$month,$day) = Easter_Sunday($ARGV[0]);&lt;BR /&gt;print "Easter is $month/$day/$year\n";&lt;BR /&gt;&lt;BR /&gt;Run as:&lt;BR /&gt;&lt;BR /&gt;# ./easter 2006&lt;BR /&gt;Easter is 4/16/2006&lt;BR /&gt;&lt;BR /&gt;...or pass any year to it.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Feb 2006 15:58:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739193#M101340</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-24T15:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739194#M101341</link>
      <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;By the way, the computation of Easter's date can be done according to the algorithm presented here, if you really want to do so:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://aa.usno.navy.mil/faq/docs/easter.html" target="_blank"&gt;http://aa.usno.navy.mil/faq/docs/easter.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Feb 2006 16:03:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739194#M101341</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-24T16:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739195#M101342</link>
      <description>Okay Ryan, I found my old shell script, easter.sh. Invoke as easter.sh -u for full usage but basically it outputs MM DD of Easter for a given year. If no year argument is supplied, the current year is used.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2006 16:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739195#M101342</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-24T16:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739196#M101343</link>
      <description>Hi A. Clay and JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks very much for the quick answers. I will probably use A. Clay's script only because my Perl skills are so limited.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ryan&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2006 16:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739196#M101343</guid>
      <dc:creator>Ryan Clerk</dc:creator>
      <dc:date>2006-02-24T16:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739197#M101344</link>
      <description>Hmmm, maybe you should consider simply picking up a table like the one posted in the website pointed to by JRF.&lt;BR /&gt;&lt;BR /&gt;Then you would just check the year against the end of the table, giving an error when it needs to be updated, or giving the date when it is there. &lt;BR /&gt;It would be as much code, much less error prone and readily tweakable for future special cases&lt;BR /&gt;&lt;BR /&gt;Just a thought...&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://aa.usno.navy.mil/faq/docs/easter.html" target="_blank"&gt;http://aa.usno.navy.mil/faq/docs/easter.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Feb 2006 04:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739197#M101344</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-02-25T04:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739198#M101345</link>
      <description>Hi experts,&lt;BR /&gt;&lt;BR /&gt;As a follow up to this question, I would like to send out a notification on the two Mondays before the Easter weekend. How could I make a cron entry which would do this?&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;Ryan</description>
      <pubDate>Thu, 02 Mar 2006 15:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739198#M101345</guid>
      <dc:creator>Ryan Clerk</dc:creator>
      <dc:date>2006-03-02T15:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739199#M101346</link>
      <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;You could cron something like this:&lt;BR /&gt;&lt;BR /&gt;0 8 3,10 4 1 mailx -s "Easter is April 16" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Look at the manpages for 'crontab(1)'.  The line above generates a mail to "root" with the message "Easter is April 16" on April 3 and April 10 (Mondays) at 0800.&lt;BR /&gt;&lt;BR /&gt;Add that line to your root crontab or create a root crontab with 'vi'.&lt;BR /&gt;&lt;BR /&gt;I like to do:&lt;BR /&gt;&lt;BR /&gt;# crontab -l &amp;gt; /tmp/mycrontab&lt;BR /&gt;[ edit ]&lt;BR /&gt;# crontab /tmp/mycrontab&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 02 Mar 2006 15:25:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739199#M101346</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-03-02T15:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739200#M101347</link>
      <description>Okay, I'll assume that you can make a cron entry. I would let your cron entry run every Monday and let the script itself decide if this is one of the 2 "magic" Mondays. That will be defined as those less &amp;lt;= 14 days before Easter but &amp;gt; 0. The firest thing to do is modify the previous easter.sh program to output MM DD YYYY and then it becomes a simple date calculation problem. Hmmm, I wonder what tool to use for that?&lt;BR /&gt;&lt;BR /&gt;Your cron script should look 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 STAT=0&lt;BR /&gt;typeset -i EDAYS=$(( $(caljd.sh $(easter.sh)) - $(caljd.sh) ))&lt;BR /&gt;if [[ ${EDAYS} &amp;lt;= 14 &amp;amp;&amp;amp; ${EDAYS} -ge 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Do your thing"&lt;BR /&gt;    # set STAT to a valid value for return&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;Here is the revised easter.sh that also outputs the year expected by caljd.sh.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2006 15:31:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739200#M101347</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-02T15:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739201#M101348</link>
      <description>And here is the other piece, caljd.sh. Invoke as caljd.sh -u for full usage.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2006 15:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739201#M101348</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-02T15:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739202#M101349</link>
      <description>I did assume that you wanted a completely automatic method so that you would not have to lookup easter each year and could just maintain a list of users (preferably from a file or simple a mail alias.).&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2006 15:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739202#M101349</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-02T15:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739203#M101350</link>
      <description>Ooops, I'm an idiot. I zigged when I should have zagged.&lt;BR /&gt;&lt;BR /&gt;if [[ ${EDAYS} &amp;lt;= 14 &amp;amp;&amp;amp; ${EDAYS} -ge 0 ]]&lt;BR /&gt;&lt;BR /&gt;SHOULD BE:&lt;BR /&gt;if [[ ${EDAYS} -le 14 &amp;amp;&amp;amp; ${EDAYS} -ge 0 ]]&lt;BR /&gt;&lt;BR /&gt;No points for this stupidity please.</description>
      <pubDate>Thu, 02 Mar 2006 15:38:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739203#M101350</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-02T15:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739204#M101351</link>
      <description>Hi (again) Ryan:&lt;BR /&gt;&lt;BR /&gt;Actually, so you don't get every Monday, unconditionally, change my crontab line to be:&lt;BR /&gt;&lt;BR /&gt;0 8 3,10 4 * mailx -s "Easter is April 16" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Now you will get a mail on April 3 and April 10 announcing the pending Easter.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2006 15:39:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739204#M101351</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-03-02T15:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739205#M101352</link>
      <description>Hi James and A. Clay,&lt;BR /&gt;&lt;BR /&gt;Thanks for the very quick answers. I'll study these and decide which one to use.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ryan</description>
      <pubDate>Thu, 02 Mar 2006 16:05:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739205#M101352</guid>
      <dc:creator>Ryan Clerk</dc:creator>
      <dc:date>2006-03-02T16:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739206#M101353</link>
      <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;The original Perl script I offered can be embellished slightly.  Then, add a small shell wrapper to define the number of days before Easter that you want to generate a mail event.&lt;BR /&gt;&lt;BR /&gt;Cron the shell wrapper to run whenever you want it to run.  This could be every day of every year if you choose.  The shell wrapper is silent unless Easter is 14-days or less away.  As a cron'ed script, un-redirected output is mailed to the initiating user, so you don't have to do anything more than run it.&lt;BR /&gt;&lt;BR /&gt;The Perl script is attached and is called '.easter.pl'.  If you run it without an argument the current year is assumed.  It's output looks like this:&lt;BR /&gt;&lt;BR /&gt;# ./easter.pl&lt;BR /&gt;45 days from now is Easter on 04/16/2006&lt;BR /&gt;&lt;BR /&gt;# ./easter.pl 2007&lt;BR /&gt;402 days from now is Easter on 04/08/2007&lt;BR /&gt;&lt;BR /&gt;The shell wrapper to cron looks like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;RSLT=`/usr/local/bin/easter.pl`&lt;BR /&gt;LEFT=`echo ${RSLT} | cut -f1 -d " "`&lt;BR /&gt;if [ "${LEFT}" -le 14 ]; then&lt;BR /&gt;    echo ${RSLT}&lt;BR /&gt;fi&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 02 Mar 2006 19:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739206#M101353</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-03-02T19:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739207#M101354</link>
      <description>Hi (again) Ryan:&lt;BR /&gt;&lt;BR /&gt;Ooops.  Since I'm sure you don't want a notice announcing that Easter has passed; as for instance, on April 17 that Easter was -1 days ago for 2006.&lt;BR /&gt;&lt;BR /&gt;Therefore, cron this shell wrapper:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;RSLT=`/usr/local/bin/easter.pl $1`&lt;BR /&gt;LEFT=`echo ${RSLT} | cut -f1 -d " "`&lt;BR /&gt;if [ "${LEFT}" -ge 0 -a "${LEFT}" -le 14 ]; then&lt;BR /&gt;    echo ${RSLT}&lt;BR /&gt;fi&lt;BR /&gt;exit 0 &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 02 Mar 2006 20:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739207#M101354</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-03-02T20:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Easter Date?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739208#M101355</link>
      <description>Absolutely, that was my reason for &amp;lt;= 14 and &amp;gt; 0 because in my script, -days would indicate that we had passwd Easter for the current year.</description>
      <pubDate>Thu, 02 Mar 2006 21:39:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easter-date/m-p/3739208#M101355</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-02T21:39:01Z</dc:date>
    </item>
  </channel>
</rss>

