Scheduled programs (cron jobs)


In order to clean out several of the logfiles used by the system as well as send out the newsletter itself, three different programs need to be setup in the crontab:
mass-mailer.pl
This script performs the daily mailing of the newsletters. It should be configured to start running later into the evening as to try to catch the Internet at its quiet time in North America.

clean-pending.pl
This script cleans out the pending registration file of any old, expired pending registrations. It may be scheduled to run at any point and may not even run each day if not necessary. It is recommended to run daily, however, in order to keep the pending registrations filesize to a minimum. Note that only entries in the pending registration file that have expired will be removed.

calculate-payments.pl
This script calculates the monthly payments for each sponsor in the system and e-mails a list of cheques to be written to the newsletter administrator. This script should be scheduled to run on a monthly basis.

email-stats.pl
This script e-mails the system statistics along to the newsletter administrator. It should be run daily via cron and configured to run in the same command line as 'clean-logs.pl' (see below). This is required as once the stats are generated, the logs should be cleaned out for the next period.

clean-logs.pl
This script is used to clean out the logfiles relating to the number of new users and cancelled users for each subscriber. These logfiles are used exclusively for the system statistics. Ideally this program should be schedule to run at a time which would be just after the stats have been pulled for the day as once they are cleaned out any statistics from the day prior are removed.

All of these scripts are required to be run as the user which your Webserver runs as. This may require you to set a valid shell for that user. Example lines for each cron job are as follows:

0 0  * * * nobody (cd /usr/local/htdocs/cgi/scripts/ ; ./mass-mailer.pl)
0 9  * * * nobody (cd /usr/local/htdocs/cgi/scripts/ ; ./clean-pending.pl)
0 17 * * * nobody (cd /usr/local/htdocs/cgi/scripts/ ; ./email-stats.pl ; ./clean-logs.pl)
0 23 1 * * nobody (cd /usr/local/htdocs/cgi/scripts/ ; ./calculate-payments.pl)