Periodic tasks (cron)

Some tasks should be run periodically via cron.

Sending of scheduled messages

Sending of daily e-mail reports

Statistics aggregation from routelog into emgp_hourly_summary

Replace "http://www.example.com/emgportal" with the base url for your installation of EMG Portal.

# Send daily report for current month shortly after midnight
5 0 * * *   /usr/bin/wget -O - http://www.example.com/emgportal/cron/reportMonth >/tmp/cron_report.log 2>&1
# Send scheduled jobs every 5 minutes
*/5 * * * * /usr/bin/wget -O - http://www.example.com/emgportal/cron/sendScheduled >/tmp/cron_send.log 2>&1
# Aggregate new message stats when present, check every minute
* * * * *        /opt/emg/bin/hourly_summary.pl >>/tmp/cron_hourly_summary.log 2>&1

In order for cron requests to work you need to add the ip address which accesses cron urls to 'cronAllowedIps' array in EMG Portal protected/config/main.php.

Script hourly_summary.pl

The script hourly_summary.pl is included in EMG Portal distribution as "hourly_summary.pl.sample".

Copy it to a location of your choice, change the database settings in the script and add it to cron as in the example above with the path adjusted to your system setup.