Answers.Body: <p>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 <a href="https://civicrm.stackexchange.com/questions/3918/civicrm-cron-only-run-one-mail-report-scheduled-jobs">civiCRM Cron only run one mail_report scheduled jobs?</a></p>
  
  <p>By setting a scheduled job and setting the parameters, wp-cli triggrs the job just fine.</p>
  
  <p>I am curious if drush exhibits the same behavior</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T02:24:26.457Z
Answers.LastActivityDate: 2015-09-27T02:24:26.457Z
Answers.LastEditDate: 2017-04-13T12:53:13.207Z
Answers.UserDisplayName: Kevin Cristiano
Body: <p>Running scheduled jobs using wp-cli doesn't work, whereas CiviCRM's cli.php does work.</p>
  
  <p>I'm running CiviCRM 4.6.8 on Wordpress. </p>
  
  <p>When I try to execude scheduled jobs using wp-cli:</p>
  
  <p><code>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</code></p>
  
  <p>I get the following result, although the mailings are not sent (remain in Scheduled state).</p>
  
  <p><code>Array
  (
      [is_error] =&gt; 0
      [version] =&gt; 3
      [count] =&gt; 1
      [values] =&gt; 1
  )
  </code>
  The same goes for running <code>wp civicrm process-mail-queue</code></p>
  
  <p>However, using old cli.php I can run the jobs. </p>
  
  <p><code>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</code></p>
  
  <p>What am I doing wrong?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-26T23:28:36.417Z
Comments.Text: 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.
Comments.UserDisplayName: Kevin Cristiano
Tags: <wordpress><cron-job><mailing>
Title: Running scheduled jobs from wp-cli doesn't work
ThreadText: # Running scheduled jobs from wp-cli doesn't work
  
  (Asked by: username_0 on 2015-09-21)
  
  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?
  
  **Tags:** wordpress, cron-job, mailing
  
  > **Comments:**
  > **username_1**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-09-27. Score: 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?](https://civicrm.stackexchange.com/questions/3918/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
  
  
  ---
  
  