2

Running scheduled jobs using wp-cli doesn't work, whereas CiviCRM's cli.php does work.

I'm running CiviCRM 4.6.8 on Wordpress.

When I try to execude scheduled jobs using wp-cli:

sudo -u www-data /usr/local/bin/wp --user=my_wp_login --url=https://www.mysite.pl --path=/home/www/wordpress civicrm api job.execute auth=0

I get the following result, although the mailings are not sent (remain in Scheduled state).

Array ( [is_error] => 0 [version] => 3 [count] => 1 [values] => 1 ) The same goes for running wp civicrm process-mail-queue

However, using old cli.php I can run the jobs.

usr/bin/php5 /home/www/wordpress/wp-content/plugins/civicrm/civicrm/bin/cli.php -s www.mysite.pl -u cron -p passord -e Job -a execute

What am I doing wrong?

  • I don't see anything wrong with your syntax. I have found that sometimes plugins through errors that halt CiviCRM. If that is the case, it should also fail from the cli.php method. You can check your error logs and see if there is a reason, I find it doubtful as [is_error] reports false. If you can reply here it will be helpful for troubleshooting. – Kevin Cristiano Sep 26 '15 at 23:28
1

In looking into this a bit further I have failed to get the job to run via the wp-cli by specifing mail_report and instanceId=x, however, this answer works well with wp-cli civiCRM Cron only run one mail_report scheduled jobs?

By setting a scheduled job and setting the parameters, wp-cli triggrs the job just fine.

I am curious if drush exhibits the same behavior

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.