X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fschedule%2Fgenerate_reminders.pl;h=8c49f3fb5c2a139d2bb4e98c8cfb9562994f9df8;hb=b8551035b3535ad383cf5751551d34892df91fc0;hp=0cb70081583b5400f0a64cc0fdadb322d86486fa;hpb=2952ccf47b80174880141a7ecfa122089f349b8d;p=feisty_meow.git diff --git a/scripts/schedule/generate_reminders.pl b/scripts/schedule/generate_reminders.pl index 0cb70081..8c49f3fb 100644 --- a/scripts/schedule/generate_reminders.pl +++ b/scripts/schedule/generate_reminders.pl @@ -21,12 +21,14 @@ # # Apr 24 Saint Shanty's Day # Jul 8 Normality Day +# Oct 24 1985 Saint Splivven's Day # # Month names must currently be three letters and must be capitalized. -# The day must be a number, followed by a space. Anything after that -# space is considered the description of the event. +# The day must be a number, followed by a space. An optional 4 digit +# year can be included. Anything after that is considered to be the +# description of the event. -require "importenv.pl"; +use Env qw(CLOUD_BASE TMP); ############## @@ -34,16 +36,16 @@ require "importenv.pl"; local($TEMPO_FILE) = `mktemp "$TMP/zz_reminder.XXXXXX"`; chop($TEMPO_FILE); -local($USERNAME) = "$REPLYTO"; -if (! $USERNAME) { $USERNAME="fred" } +local($USER_NAME) = "$REPLYTO"; +if (! $USER_NAME) { $USER_NAME="fred" } -#print "TEMPO is $TEMPO_FILE ; USER is $USERNAME ; \n"; +#print "TEMPO is $TEMPO_FILE ; USER is $USER_NAME ; \n"; local($CAL_FILE); if (! $CAL_FILE) { # print "the CAL_FILE variable is not set.\n"; # print "defaulting it to a value that probably does not suit you.\n"; - $CAL_FILE = "$QUARTZDIR/database/calendar.dat"; + $CAL_FILE = "$CLOUD_BASE/magic_cabinet/lists/calendar.dat"; } #print "calfile is $CAL_FILE\n"; @@ -77,7 +79,8 @@ for ($i = 0; $i < 24; $i += 2) { #print "got days wik @days\n"; #print "got next mon wik @next_month\n"; -local(@date_as_array) = split(' ', `date`); +local(@date_as_array) = split(' ', `date '+%a %b %d %Y'`); +#print( "date as array: @date_as_array\n"); ############## @@ -133,8 +136,8 @@ while () { # send mail here if there's anything to say. if (! -z $TEMPO_FILE) { # there are some alerts in there. -#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE\");\n"; - system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE"); +#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE\");\n"; + system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE"); } unlink $TEMPO_FILE;