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 CiviMail (Moderator: Piotr Szotkowski) »
  • Job scheduler does not run when cron job is run
Pages: [1]

Author Topic: Job scheduler does not run when cron job is run  (Read 1795 times)

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Job scheduler does not run when cron job is run
February 06, 2013, 08:03:27 pm
Drupal 7.14
CiviCRM 4.1.5

We are running in an AWS environment. The cron job executes this command every minute:

#! /bin/bash

/usr/bin/curl --data @civicrm-curl \
 https://www.example.com/sites/all/modules/civicrm/bin/cron.php

(true site name masked)

The civicrm-curl file looks like this:

name=realuser&pass=realpassword&key=realkey&job=process_mailing

(credentials masked but they are verified correct on our production site)

I have also tried using wget and cli but the process_mailing job never executes. we always have to go to the job scheduler and kick it off manually


andrewhunt

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 13
    • AGH Strategies
  • CiviCRM version: all of 'em
  • CMS version: Drupal, Joomla, and WordPress
Re: Job scheduler does not run when cron job is run
February 07, 2013, 06:56:34 am
Have you tried going in a browser to
https://www.example.com/sites/all/modules/civicrm/bin/cron.php?name=realuser&pass=realpassword&key=realkey

That should run all your scheduled jobs, and if there's an error, you'll probably see it on screen.  Also, have you made sure to change the scheduled job for outgoing mail to run every time?  It's set to hourly by default, so unless you change that, it'll ignore all the times you run it until an hour from the last time it ran.
You can find me at AGH Strategies.
Need help now?  Civi911 is your go-to for CiviCRM support.

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Job scheduler does not run when cron job is run
February 07, 2013, 04:11:24 pm
As Andrewhunt mentioned, look at Scheduled Jobs: Administer -> System Settings -> Scheduled Jobs.

By default, I have found that everything is set to an hour but they are also not active so you can ping cron all day long and it won't run your jobs.

I'm on a Plesk 11 server and successfully using wget as follows:

wget -qO- 'http://www.example.com/sites/all/modules/civicrm/bin/cron.php?name=myname&pass=mypass&key=mykey'
« Last Edit: February 07, 2013, 04:14:08 pm by awasson »
My CiviCRM Extension Workshop: https://github.com/awasson

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 07, 2013, 06:28:09 pm
The job is enabled and set to run every time cron is run.

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 07, 2013, 06:44:23 pm
What time of response should I see from wget (without the -Q)?

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Job scheduler does not run when cron job is run
February 07, 2013, 06:48:40 pm
Quote from: Dennis Gray on February 07, 2013, 06:44:23 pm
What time of response should I see from wget (without the -Q)?

I couldn't tell you. I set up a bunch of things to run with Cron so that I could see if it was just mail or if nothing was running and then I looked at the logs to see what was going on.

The trouble I had was two-fold:
1) I didn't enable them to run under the Scheduled Jobs
2) My cron was failing

Have you directed a web browser at cron to see if it is doing anything?

http://www.example.com/sites/all/modules/civicrm/bin/cron.php?name=myname&pass=mypass&key=mykey



My CiviCRM Extension Workshop: https://github.com/awasson

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 07, 2013, 07:06:40 pm
Yes...I have tried that. I get no output.

My cron job is running. There are other tasks there that do get executed.

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 07, 2013, 07:59:40 pm
Here is a snippet from the job log which shows that the Mailing scheduler job is being run. The message indicates success but anything in "scheduled" status never runs.

2013-02-08 03:57:05   Mailings scheduler   
0
Summary
Finished execution of Mailings scheduler with result: Success (a:0:{})
Details


Parameters raw (From cron.php):
a:1:{s:7:"version";i:3;}

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Mailings scheduler with result: Success (a:0:{})

2013-02-08 03:57:02   Mailings scheduler   
0
Summary
Starting execution of Mailings scheduler
Details


Parameters raw (From cron.php):
a:1:{s:7:"version";i:3;}

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Starting execution of Mailings scheduler

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Job scheduler does not run when cron job is run
February 07, 2013, 08:57:41 pm
Oh that is like nothing I've ever experienced.

How about if you directly ping the email scheduler in a URL (web browser): http://www.example.com/civicrm/mailing/queue?reset=1&name=myname&pass=mypass&key=mykey

By the way, I'll be off and on the computer so I may not make it back tonight.
My CiviCRM Extension Workshop: https://github.com/awasson

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 07, 2013, 09:47:48 pm
Hmmm....that worked. I can, as a workaround, set up the cron job to wget that URL but still would like to keep this open

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 08, 2013, 12:42:29 am
I'll post as a bug

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Job scheduler does not run when cron job is run
February 08, 2013, 02:13:28 pm
Let me know how that works out.

It sounds to me like a bug with the Scheduled Jobs part of the system.

Cheers,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Job scheduler does not run when cron job is run
February 09, 2013, 03:33:46 am
I've got another AWS instance now so will do some testing there. I've got an instance running on an Ubuntu server as well and there is no problem

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Job scheduler does not run when cron job is run

This forum was archived on 2017-11-26.