CiviCRM includes a number of PHP scripts which process data and handle batch tasks "in the background". These scripts are run from the server command line, often as automatically scheduled "cron" jobs. Except where otherwise noted, all of these scripts are located in the bin directory below your main CiviCRM install directory.

NOTE: Some scripts require additional editing before use (e.g. to configure the correct FROM email address for membership renewal reminders). These scripts are delivered with a .txt extension and must be renamed before use.

Component

Script Filename

Description

CiviMail

civimail.cronjob.php

Sends queued CiviMail mailings

CiviMember

UpdateMembershipRecord.php

Updates membership statuses and optionally sends renewal reminders

CiviPledge

UpdatePledgeRecord.php

Updates pledge payment and pledge statuses and optionally sends payment reminders

Core

UpdateAddress.php

Geocodes addresses in bulk

Core and CiviCase

Email2Activity.php

Inserts activity for a contact or a case (v2.2+) by retrieving inbound emails from a mail directory

(all}

CRM/Utils/REST.php

Handles REST API calls

You are required to pass authentication information at runtime to prevent these scripts from being invoked by an unauthorized agent. As of versions 2.1.2 OR 2.0.7 , a Site Key is required in addition to a valid username and password. Include all three parameters when invoking these scripts:

EXAMPLE: Using wget to run the UpdateMembershipRecord.php script in a Drupal installation, the command line would look like this:

$ wget 'http://<drupal_root>/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=<username>&pass=<password>&key=<sitekey>'

Make sure there that there are no reserved or unsafe URL characters in your username or password. These include:

& = + $ ? % , / : { } #

and spaces.

Configuring your Site Key

For CiviCRM versions 2.0.7+ and 2.1.2+ - you must manually generate a site key, and then add it to your CiviCRM settings file.

Depending on which version of CiviCRM you've installed, you may have this setting in your file already with a value of null, or you may need to add the line. In either case, replace null with the value of your key.

EXAMPLE: If my generated site key value is: 3cx4aNkpQwxmM1hTMV~!B09iO6
... then my settings file should look like this:

define( 'CIVICRM_SITE_KEY', '3cx4aNkpQwxmM1hTMV~!B09iO6' );