CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Script for cron job and multiple sites
Pages: [1]

Author Topic: Script for cron job and multiple sites  (Read 832 times)

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Script for cron job and multiple sites
May 16, 2009, 11:43:28 am
I'm running multiple Joomla/CRM installs on the same box, and I was trying to find a way of simplifying the CRON tasks, so I wrote the following shell script which I thought someone might find useful.

Code: [Select]
#!/bin/sh

#List the URL and script location
CIVIMAILURL[0]="http://www.example.com/administrator/components/com_civicrm/civicrm/bin/"
CIVIMAILURL[1]="http://www.another_example.com/administrator/components/com_civicrm/civicrm/bin/"
CIVIMAILURL[2]="http://www.and_another_example.com/administrator/components/com_civicrm/civicrm/bin/"

#List the keys for each installation
CIVIMAILPASS[0]="?name=<script_user>&pass=<password>&key=<site_key>"
CIVIMAILPASS[1]="?name=<2nd_script_user>&pass=<password>&key=<2nd_site_key>"
CIVIMAILPASS[2]="?name=<3rd_script_user>&pass=<password>&key=<3rd_site_key>"

#Common variables here...
JOB[0]="civimail.cronjob.php"
JOB[1]="UpdateMembershipRecord.php"
JOB[2]="UpdatePledgeRecord.php"
JOB[3]="Email2Activity.php"

#Execute Links here
for (( i = 0 ; i < ${#CIVIMAILURL[@]} ; i++ ))
do
    for (( j = 0 ; j < ${#JOB[@]} ; j++ ))
     do
       echo Curling..
       JOBURL=${CIVIMAILURL[$i]}${JOB[$j]}${CIVIMAILPASS[$i]}
       #echo $JOBURL
        /usr/bin/curl -s $JOBURL     
       done
  #echo "Done"
done
Too err is human, to really foul things up needs a computer.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Script for cron job and multiple sites

This forum was archived on 2017-11-26.