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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Cron Job or Alternative Method to update and fix contacts?
Pages: [1]

Author Topic: Custom Cron Job or Alternative Method to update and fix contacts?  (Read 1078 times)

ijames

  • Guest
Custom Cron Job or Alternative Method to update and fix contacts?
February 02, 2010, 04:03:01 am
We've got individual contacts that are being created in a couple of ways.  Through the admin interface, through imports, and through SOAP which calls APIs.

There are custom fields that I'd want to set, or other activities I'd like to do, including hitting constant contact. 

In these various methods are gaps to getting everything set correctly.  The main operation through the UI run hooks when the contact is created to perform most of the work.

But I want to make sure they also work when calling through the API and I'd also like to have the cron running to fill any holes and keep other data up to date.

So I was wondering how do I setup a custom cron?  What does it call and where can I place my code to make the calls and hit the hooks I need it to hit? 

Thanks!

James

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Cron Job or Alternative Method to update and fix contacts?
February 02, 2010, 06:34:17 am

since u r in drupal, u might want to setup a custom module and implement the hook_cron there

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ijames

  • Guest
Re: Custom Cron Job or Alternative Method to update and fix contacts?
February 02, 2010, 01:41:03 pm
Thanks Lobo!

My Drupal knowledge is 1/8 of my CiviCRM knowledge. 

Has anybody done this?

Can I from the Drupal cron loop through the CiviCRM contacts?


ijames

  • Guest
Re: Custom Cron Job or Alternative Method to update and fix contacts?
February 02, 2010, 05:51:46 pm
So I've got the basic module working in drupal and it seems to be correctly calling _civicrm_post.

But it doesn't seem to be calling _hook_cron.

I've got it named <module>_hook_cron

Is that wrong?

When I call site.com/cron.php  it does nothing and there don't seem to be any errors?

But it does look like I can include the different civicrm files and then use the api for manipulating the data.

Cool!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Cron Job or Alternative Method to update and fix contacts?
February 02, 2010, 08:04:19 pm

use <module>_cron

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Cron Job or Alternative Method to update and fix contacts?

This forum was archived on 2017-11-26.