Question:

I installed CiviCRM on my server, and I want to set up a cron job to trigger CiviCRM's cron job script. What should I do to set up the cron job?

Answer:

As recommended by CiviCRM officially at here, you may use EasyCron to trigger cron job script in CiviCRM.

Our webcron service is best for triggering CiviCRM's cron job script. Just follow below simple steps to configure cron job for your CiviCRM:

  1. Open your cron job dashboard, click on " Cron Job" button. Choose either step #2 or #3 below to proceed.
  2. Run Scheduled Jobs using POST Method
    • In field "URL to call", enter:
      http://www.example.org/sites/all/modules/civicrm/bin/cron.php (In Drupal)
      http://www.example.org/administrator/components/com_civicrm/civicrm/bin/cron.php (In Joomla)
      http://www.example.org/wp-content/plugins/civicrm/civicrm/bin/cron.php (In WordPress)
      (replace www.example.com with your install location).
    • Choose an appropriate cron job execution frequency (for CiviCRM, we recommend to have the cron job run "every 15 minutes"). Checkout below screenshot:
    • In the POST field, enter: name=username&pass=password&key=site-key


    Set up cron job for CiviCRM with POST Method
  3. Run Scheduled Jobs using GET Method
    • In field "URL to call", enter:
      http://www.example.org/sites/all/modules/civicrm/bin/cron.php?name=username&pass=password&key=site-key (In Drupal)
      http://www.example.org/administrator/components/com_civicrm/civicrm/bin/cron.php?name=username&pass=password&key=site-key (In Joomla)
      http://www.example.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=username&pass=password&key=site-key (In WordPress)
      (replace www.example.com with your install location).
    • Choose an appropriate cron job execution frequency (for CiviCRM, we recommend to have the cron job run "every 15 minutes"). Checkout below screenshot:

    Set up cron job for CiviCRM with GET Method
  4. Note: Regarding the site-key generating and setting, please check the " Configuring your Site Key" section in civiCRM document

  5. If necessary, finish the other optional settings.
  6. Click "Create Cron Job" button. You're done! EasyCron will trigger your CiviCRM's cron job script dutifully according to your time setting.
  7. If you haven't registered your EasyCron account yet, click on the "add a password" link on the top to add an email and password to your account.