Loading

Scheduled Jobs (cronjobs)

Scheduled Jobs for Dada Mail

Some of Dada Mail's more powerful features depend on a cronjob to be run on a periodic schedule.

Only one cronjob is required for all scheduled tasks in Dada Mail. It is composed of a URL that will need to be accessed.

Here's an exmaple:

http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

http://example.com/cgi-bin/dada/mail.cgi is just the URL to your Dada Mail,

A full cronjob would look like this:

    */5 * * * * /usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

*/5 * * * * sets the schedule to run this job every 5 minutes,

/usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url is the curl command, with different paramaters passed to grab the URL and,

http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

is the URL we want to grab.

Schedule Flavor

_sched513A3F128C5C41EC is an individual flavor for our specific install of Dada Mail. It's meant to be somewhat unique, so that someone nefarious doesn't start running all the schedules for all Dada Mail installations it can find.

This flavor can be set when installing Dada Mail via the Dada Mail Installer. It can also be set manually in your .dada_config file, in the SCHEDULED_JOBS_OPTIONS hashref. Look for the scheduled_jobs_flavor paramater.

If you would like to customize the Schedule Flavor, the value of this paramater should only contain letters, numbers and underscores. Anything too tricky will foil the run mode dispatch code of Dada Mail. This value should also NOT be the same as an already-existing flavor/run mode

Job To Run

The next value in the path, _all describes which jobs to run. _all is special: it runs all the jobs can be run.

You can also modify this to run a specific job. The following are also supported:

Mailing List to Run

The next value in the path, _all (and then second _all found) describes which list to run jobs for. _all is specially, as it will run jobs for all the mailing lists you have. If you would like to run jobs for just one mailing list, you can change this paramater the list short name of that list.

Job Output

By Default, this is set to, _verbose which will print out the output for all the jobs run. If you would like to suppress this, you can, by setting this to, _silent.

Another option is to supress the output in the cronjob itself, like this:

*/5 * * * * /usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_verbose/ >/dev/null 2>&1

Running the scheduled jobs via the command line.

There's no special command-line way to run these jobs, although you can invoke Dada Mail on the command line easy enough. The following:

    cd /home/youraccount/public_html/cgi-bin/dada; /usr/bin/perl ./mail.cgi flavor=_sched513A3F128C5C41EC schedule=_all list=_all output_mode=_verbose

Will do the same thing, as our initial example for curl.

Retrieving the Cronjob

If you need to access the scheduled job URL again, log into your list control panel (any list will do) and go to, App Information - Scheduled Job


Dada Mail Project

Download

Installation

Support