Changes between Version 1 and Version 2 of sysadminGeneratingEmailNotices


Ignore:
Timestamp:
Jun 24, 2009, 12:20:40 AM (13 years ago)
Author:
Dan Scott
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • sysadminGeneratingEmailNotices

    v1 v2  
    55Out of the box, Evergreen provides templates for a reminder notice the day before an item is due, and an overdue notice that is generated 7 days after the item was due.
    66
     7== Dependencies ==
     8
     9The script should be run as the '''opensrf''' user to ensure that it has access to the required configuration files and environment variables.
     10
     11We have to run the script out of the pertinent Evergreen source directory due to a dependency on '''oils_header.pl'''. Eventually we should probably just copy all the files into the normal /openils/bin directory, but for now we start everything with:
    712{{{
    8 # We run the script out of the source directory due to a dependency on oils_header.pl
    9 # Eventually we should just copy all the files into the normal bin directory
    1013cd /home/lauadmin/Evergreen-trunk/Open-ILS/src/support-scripts/
    11 # Dump the help for the script
     14}}}
     15
     16== Help ==
     17We can dump the help for the script using the following command:
     18{{{
    1219perl generate_circ_notices.pl --help
     20}}}
    1321
     22This returns:
     23
     24{{{
    1425Evergreen Circulation Notice Generator
    1526
     
    4960    --help
    5061        Print this help message
    51 # So, to dump the output of both reminders and overdues into a file for review for the last 7 days:
     62}}}
     63
     64== Testing ==
     65So, to dump the output of both reminders and overdues into a file for review for the last 7 days:
     66{{{
    5267perl generate_circ_notices.pl --use-email-outfile ~/fakeemail.lst --notice-type overdue,predue --days-back 0,1,2,3,4,5,6,7
    5368}}}
     69
     70Note that it doesn't really make sense to dump the reminders for the last 7 days, because the previous days will be warning people about items being overdue tomorrow, when in fact they might be as much as 6 days overdue by that time. But it does give you an idea of what would have been sent.
     71
     72== Cron job ==
     73Putting all of this together, a cron job is scheduled under the '''opensrf''' user on '''protostar.cs.uoguelph.ca''' - with one additional wrinkle. Because cron environments aren't run in the user's login shell, we have to set certain environment variables manually. In this case, we need to set '''PERL5LIB'''. So, to schedule the overdue and reminder notices to run at 06:01 every day:
     74{{{
     7501 06 * * * cd /home/lauadmin/Evergreen-trunk/Open-ILS/src/support-scripts/; PERL5LIB=/openils/lib/perl5 perl generate_circ_notices.pl --send-email --notice-type overdue,predue }}}