Answers.Body: <p>I use <code>cv</code> to run cron on D8, e.g.:</p>
  
  <pre><code>12,27,42,57 * * * * /usr/local/bin/cv --cwd=/var/www/crm.mysite.org/web --user=admin --quiet api job.execute
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-15T16:40:40.163Z
Answers.Text: I was trying to avoid installing yet another thing, but if this is the only way, then I guess I have little choice.
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-15T16:44:58.350Z
Answers.Text: There may be other ways - but `cv` is the `drush` of CiviCRM, and has a million helpful little features, so it's a standard on any of my servers.  You won't regret it!
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-15T22:34:27.033Z
Answers.Text: Ah, it's also self-contained. :) I can trigger the scheduled jobs with it, but it doesn't properly work unless the user is an administrator. I gave a special user civi backend and api access (+ajax + civimail), but it doesn't appear to be enough for civimail. What do you use?
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-16T12:42:58.347Z
Answers.Text: I use a full administrator account (see above). If someone has shell access to my server with the permissions to run `cv`, they have permissions to read `settings.php` and `civicrm.settings.php` so there's little benefit in using a less privileged account.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-16T18:22:11.827Z
Answers.Text: Good point. I see I can't use it properly though, since it has a bug: https://github.com/civicrm/cv/issues/51 off to trying drush integration, grrr
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-15T16:08:11.853Z
Answers.LastActivityDate: 2019-09-15T16:08:11.853Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>It turns out <code>cv</code> is the only way to go on drupal8. Drush 9 is not supported yet and the web invocations don't work due to the split paths of the civi install.</p>
  
  <p>If it only works for you when invoked directly and not from cron, check its output. I was hitting a somewhat <a href="https://github.com/civicrm/cv/issues/51" rel="nofollow noreferrer">buggy php test</a>. You have to make sure php runs in cli mode.</p>
  
  <p>EDIT: Official docs updated.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-17T07:23:23.763Z
Answers.LastActivityDate: 2019-09-18T18:33:39.567Z
Answers.LastEditDate: 2019-09-18T18:33:39.567Z
Answers.UserDisplayName: lynxlynxlynx
Body: <p>The <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#php-cli" rel="nofollow noreferrer">Sysadmin guide</a> lists several methods to run the internal cron. On the previous site we used the http method, but now on drupal8 neither this nor calling cli.php works.</p>
  
  <p>It seems a bit obvious, since some files by design remain in vendor/ and the rest are in the web visible [civicrm.files] path. JonG has a <a href="https://hq.megaphonetech.com/projects/commons/wiki/CiviCRM_for_Drupal_8_installation_notes" rel="nofollow noreferrer">related note</a> in his install instructions, but the PR wasn't merged, plus it seems to just tackle the composer plugin. I tried with the file anyway, but it didn't help much. It silences the error for <code>bin/csv/export.php</code>, but it still doesn't work. Nothing changed for cli.php and the http method still returns a unix return status of 8.</p>
  
  <p>Any ideas? How do you run it on your drupal8 site?</p>
  
Tags: <cron><drupal-8>
Title: cron on drupal8: can't handle separate paths for vendor and library
ThreadText: # cron on drupal8: can't handle separate paths for vendor and library
  
  (Asked by: username_0 on 2019-09-15)
  
  The [Sysadmin guide](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#php-cli) lists several methods to run the internal cron. On the previous site we used the http method, but now on drupal8 neither this nor calling cli.php works.
  
  It seems a bit obvious, since some files by design remain in vendor/ and the rest are in the web visible [civicrm.files] path. JonG has a [related note](https://hq.megaphonetech.com/projects/commons/wiki/CiviCRM_for_Drupal_8_installation_notes) in his install instructions, but the PR wasn't merged, plus it seems to just tackle the composer plugin. I tried with the file anyway, but it didn't help much. It silences the error for `bin/csv/export.php`, but it still doesn't work. Nothing changed for cli.php and the http method still returns a unix return status of 8.
  
  Any ideas? How do you run it on your drupal8 site?
  
  **Tags:** cron, drupal-8
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-09-15. Score: 2 | Accepted answer
  
  I use cv to run cron on D8, e.g.:
  12,27,42,57 * * * * /usr/local/bin/cv --cwd=/var/www/crm.mysite.org/web --user=admin --quiet api job.execute
  
  > **Comments:**
  > **username_0**: I was trying to avoid installing yet another thing, but if this is the only way, then I guess I have little choice.  
  > **username_1**: There may be other ways - but `cv` is the `drush` of CiviCRM, and has a million helpful little features, so it's a standard on any of my servers.  You won't regret it!  
  > **username_0**: Ah, it's also self-contained. :) I can trigger the scheduled jobs with it, but it doesn't properly work unless the user is an administrator. I gave a special user civi backend and api access (+ajax + civimail), but it doesn't appear to be enough for civimail. What do you use?  
  > **username_1**: I use a full administrator account (see above). If someone has shell access to my server with the permissions to run `cv`, they have permissions to read `settings.php` and `civicrm.settings.php` so there's little benefit in using a less privileged account.  
  > **username_0**: Good point. I see I can't use it properly though, since it has a bug: https://github.com/civicrm/cv/issues/51 off to trying drush integration, grrr  
  
  ---
  
  ### Answer by username_0 on 2019-09-17. Score: 1
  
  It turns out `cv` is the only way to go on drupal8. Drush 9 is not supported yet and the web invocations don't work due to the split paths of the civi install.
  
  If it only works for you when invoked directly and not from cron, check its output. I was hitting a somewhat [buggy php test](https://github.com/civicrm/cv/issues/51). You have to make sure php runs in cli mode.
  
  EDIT: Official docs updated.
  
  
  ---
  
  