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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Schedule Job is not running.
Pages: [1]

Author Topic: Schedule Job is not running.  (Read 958 times)

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Schedule Job is not running.
March 17, 2015, 09:03:07 am
I have tried all different method of setting up the Schedule cronjob like drush, curl, wget, php.  But none of the method worked for me except for this one using the browser.

http://[SITEROOT]/sites/all/modules/civicrm/bin/cron.php?job=update_greeting&ct=Individual&gt=email_greeting&name=username&pass=password&key=site-key&job=send_reminder

But when i use the wget function to set a cronjob, it does not work. can anyone suggest me please how can I get this working please?

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 17, 2015, 09:12:20 am
If you run the same wget command from the command line, what is the output you get?  Also, can you please post the exact wget command you're using here (redacting sensitive info, of course)?
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 17, 2015, 12:45:26 pm
Code: [Select]
[[root@tapash ~]# wget --no-check-certificate -O - -q -t 1 'https://demo.com/sites/all/modules/civicrm/bin/cron.php?name=administrator&pass=pass@108&key=4d60361f96994ebc71dd2611a0a21df2&job=send_reminder'
[root@tapash ~]#

thats the output i get for wget. basically no output.

if i try with drush I get this

Code: [Select]
[root@tapash ~]# /usr/bin/drush -u 1 -r /www/demo @sites civicrm-api job.send_reminder auth=0 -y
You are about to execute 'civicrm-api job.send_reminder auth=0' non-interactively (--yes forced) on all of the following targets:
  /www/demo#default
Continue?  (y/n): y
Array
(
    [is_error] => 0
    [version] => 3
    [count] => 1
    [values] => 1
)
« Last Edit: March 17, 2015, 01:21:58 pm by tapash »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 17, 2015, 01:32:05 pm
Hmm - drush looks like it's working, based on the output.  I assume you have good reason to believe it's not.

You may want to try dropping "-q" from the wget command, since that gives quiet output.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 17, 2015, 02:16:21 pm
I also do not understand why drush is not working.
In the meantime, by your suggestion I removed -q from wget command. and found 403: Forbidden response. After googling a bit discovered some people resolved this problem by adding "-U Mozzila" parameter to wget command. And voila!! it worked  :o

Thanks for your help. Please let me know what other troubleshooting i can do for drush command, as it drush does not require entering password.
« Last Edit: March 17, 2015, 02:42:53 pm by tapash »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 17, 2015, 03:01:19 pm
Glad you got wget working! 

Do other drush API commands work?  For instance, this should return your contact with id = 1:
Code: [Select]
drush cvapi contact.get id=1
You can also have a wget configuration file, if you don't want passwords appearing in cron logs.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 18, 2015, 01:34:33 am
 :) Yes, your drush command returned the user info. But I had to go to the drupal directory using cd /www/demo first . Otherwise it would not run. Is that mean drush command should work in my current environment?

I also get following message above contact ID 1. what is that about? I checked my php.ini there is a line like this "disable_functions=show_source, system, shell_exec, passthru, exec, proc_open, popen, curl_multi_exec, phpinfo"

Code: [Select]
exec() has been disabled for security reasons bootstrap.inc:638      [warning]
The following restricted PHP modes have non-empty values:                [error]
disable_functions. This configuration is incompatible with drush.
Please check your configuration settings in /etc/php.ini or in your
drush.ini file; see examples/example.drush.ini for details.
exec() has been disabled for security reasons bootstrap.inc:638                                                         [warning]
exec() has been disabled for security reasons bootstrap.inc:638                                                         [warning]
exec() has been disabled for security reasons bootstrap.inc:638                                                         [warning]
Array
(
    [is_error] => 0
    [version] => 3
    [count] => 1
    [id] => 1
    [values] => Array
.....

...what is that wget configuration file you are talking about? how to set it up please?
« Last Edit: March 18, 2015, 02:05:17 am by tapash »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 18, 2015, 06:52:55 am
Try this command, and see if it works without going into /www/demo:
Code: [Select]
/usr/bin/drush -u 1 -r /www/demo @sites civicrm-api contact.get id=1 auth=0 -y
If you do "man wget" you'll see how to create a .wgetrc file - but here's an example of how I use cron and wget with a wgetrc file (this is for Wordpress, so the paths are a bit different, but the idea is the same):


I have a file at /opt/civicrm-wgetrc that consists of:
Code: [Select]
post-data=name=<username>&pass=<password>&key=<site_key>
output_document = -
quiet=on
timeout=1

Then, my cron job looks like:
Code: [Select]
*/15 * * * * /usr/bin/wget --config=/opt/civicrm-wgetrc http://<mysite>/wp-content/plugins/civicrm/civicrm/bin/cron.php
So to be clear, this approach doesn't eliminate the need to record a password - but by recording it in civicrm-wgetrc, you don't need to record it in crontab, so it won't end up in your cron logs.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 19, 2015, 02:44:07 am
This drush command has also worked to pull up the contact id 1 record.

For wget command I have copied your config. but when I run wget command i receive this
Code: [Select]
wget: unrecognized option '--config=/www/civiwgetrc'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

when i type wget --help, i could not find any command like '--config'. I am using centos 6.6, does it vary in OS?

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 19, 2015, 07:30:59 am
I'm using wget 1.15 - and I'm not running CentOS, but I thought 6.6 was fairly recent.  Seems odd that it'd be compiled without this feature:
Code: [Select]
wget --help | grep config
       --config=FILE         Specify config file to use.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 19, 2015, 07:48:50 am
I have managed to get it working with --post-data instead of --config. but job did not executed...

Also, what do you think about drush? it pulls up contact record but does not work for schedule jobs...
« Last Edit: March 19, 2015, 07:57:38 am by tapash »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Schedule Job is not running.
March 19, 2015, 07:54:40 am
Hi tapash,

I'm not sure.  It sounds like a lot of the problems are due to the hosting environment.  Do you have a dev environment under your complete control? It sounds like it's worth trying some of these changes on the dev environment to see whether it's a problem with CiviCRM or a setting put in place by the admin of that server.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: Schedule Job is not running.
March 19, 2015, 07:58:59 am
its VPS and I am doing all by myself & learning slowly.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Schedule Job is not running.

This forum was archived on 2017-11-26.