Answers.Body: <p>Your script is nicely designed for running the civi cron using "cv", quietly in the background. But you want to run it w/ noise so you can debug it.</p>
  
  <p>To start, try running it manually without the last line and see if you get anything. The main script here is "cv" (run as a php script) and the other bits are making sure cv runs with the right arguments. If it's quitting silently, try something simpler, like seeing if you can actually run php and then if you can run cv via php with a simpler argument like "vars:show".</p>
  
  <p>Documentation of cv is here: <a href="https://github.com/civicrm/cv" rel="nofollow noreferrer">https://github.com/civicrm/cv</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-05T04:17:53.083Z
Answers.Text: Thank you, Alan Dixon.  Testing an api call to the 'vars:show' target still produces no output.  Do I need to enable these API calls in the user permissions at the CMS level, somehow?
Answers.UserDisplayName: Hugh Esco
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-09T19:51:35.190Z
Answers.Text: If it were a permissions error, you should see an error to that effect. It sounds like your civicrm or cv is not setup properly. Running cv by itself should at least prompt you for the command.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-03T15:18:44.943Z
Answers.LastActivityDate: 2020-06-03T15:18:44.943Z
Answers.UserDisplayName: Alan Dixon
Body: <p>This invocation now returns a result code of 0.<br>
  And still I see no evidence that it ran my civimail,<br>
  in the browser UI, at /civicrm/mailing/browse/unscheduled,<br>
  nor in the logs at /civicrm/admin/joblog, nor in my inbox. </p>
  
  <p>I've been struggling with this issue for a moment now.  <br>
  Sorting through these issues, to get to this point is documented here:<br>
  <a href="https://civicrm.stackexchange.com/questions/35779">CiviMail cron job unable to find: civicrm.config.php, built with: roundearth/drupal-civicrm-project</a> <p></p>
  
  <pre><code>/usr/bin/nice -n19 /usr/bin/php \
      -d require /opt/local/my_client/drupal/vendor/autoload.php \
      /opt/local/my_client/drupal/vendor/civicrm/cv/bin/cv api job.execute \
      --cwd=/opt/local/my_client/drupal --user=mailprocess
  
  </code></pre>
  
  <p>My script now reads:</p>
  
  <pre><code>#!/bin/bash
  set -x
  
  CMD=$1
  CWD='/opt/local/my_client/drupal'
  CV="${CWD}/vendor/civicrm/cv/bin/cv"
  CIVIMAIL_USER='mailprocess'
  requirements="-d require ${CWD}/vendor/autoload.php"
  PHP="/usr/bin/nice -n19 /usr/bin/php"
  ARGS="--cwd=${CWD} --user=${CIVIMAIL_USER}"
  
  cd ${CWD}; ${PHP} ${requirements} ${CV} api job.execute ${ARGS}
  exit "$?"
  </code></pre>
  
Tags: <civimail><cron>
Title: My cronjob fails to run my Civimail queue. What am I missing here?
ThreadText: # My cronjob fails to run my Civimail queue. What am I missing here?
  
  (Asked by: username_0 on 2020-06-02)
  
  This invocation now returns a result code of 0.  
  And still I see no evidence that it ran my civimail,  
  in the browser UI, at /civicrm/mailing/browse/unscheduled,  
  nor in the logs at /civicrm/admin/joblog, nor in my inbox.
  
  I've been struggling with this issue for a moment now.   
  Sorting through these issues, to get to this point is documented here:  
  [CiviMail cron job unable to find: civicrm.config.php, built with: roundearth/drupal-civicrm-project](https://civicrm.stackexchange.com/questions/35779)
  
  ```
  /usr/bin/nice -n19 /usr/bin/php \
      -d require /opt/local/my_client/drupal/vendor/autoload.php \
      /opt/local/my_client/drupal/vendor/civicrm/cv/bin/cv api job.execute \
      --cwd=/opt/local/my_client/drupal --user=mailprocess
  
  ```
  
  My script now reads:
  
  ```
  #!/bin/bash
  set -x
  
  CMD=$1
  CWD='/opt/local/my_client/drupal'
  CV="${CWD}/vendor/civicrm/cv/bin/cv"
  CIVIMAIL_USER='mailprocess'
  requirements="-d require ${CWD}/vendor/autoload.php"
  PHP="/usr/bin/nice -n19 /usr/bin/php"
  ARGS="--cwd=${CWD} --user=${CIVIMAIL_USER}"
  
  cd ${CWD}; ${PHP} ${requirements} ${CV} api job.execute ${ARGS}
  exit "$?"
  
  ```
  
  **Tags:** civimail, cron
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-03. Score: 2
  
  Your script is nicely designed for running the civi cron using "cv", quietly in the background. But you want to run it w/ noise so you can debug it.
  
  To start, try running it manually without the last line and see if you get anything. The main script here is "cv" (run as a php script) and the other bits are making sure cv runs with the right arguments. If it's quitting silently, try something simpler, like seeing if you can actually run php and then if you can run cv via php with a simpler argument like "vars:show".
  
  Documentation of cv is here: <https://github.com/civicrm/cv>
  
  > **Comments:**
  > **username_0**: Thank you, username_1.  Testing an api call to the 'vars:show' target still produces no output.  Do I need to enable these API calls in the user permissions at the CMS level, somehow?  
  > **username_1**: If it were a permissions error, you should see an error to that effect. It sounds like your civicrm or cv is not setup properly. Running cv by itself should at least prompt you for the command.  
  
  ---
  
  