Body: <p>When I run this command through SSH, it is executed properly</p>
  <pre><code>drush \
      -l https://www.instituutvlaamsevolkskunst.be \
      --uid=3 \
      civicrm:api job.execute \
      --quiet
  </code></pre>
  <p>When I add it to crontab, nothing happens</p>
  <pre><code>* 5 * * * drush -l https://www.instituutvlaamsevolkskunst.be --uid=3 civicrm:api job.execute --quiet
  </code></pre>
  <p>What am I doing wrong ?</p>
  <p>I am following these instructions: <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#crontab" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#crontab</a></p>
  <p>Stefaan</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-01T22:58:03.677Z
Comments.Text: What unix user does cron run under? Does it have drush in it's PATH? Can also remove the --quiet and add `>> /tmp/drushout.txt 2>> /tmp/drusherr.txt` to get some logging.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-02T15:08:47.483Z
Comments.Text: As Demerit's comment suggests, running a command manually vs. as a cron has some subtle differences (PATH being one), because .. paranoia.  I always include the full path to my drush for that reason (especially because drush "launching" is always tricky because it tries to do a lot of magic stuff like figure out a doc root and base site). For debugging, you can also add a MAILTO line at the top of the crontab so that the errors get sent to you.
Comments.UserDisplayName: Alan Dixon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-03T20:35:04.510Z
Comments.Text: tnx, first of all I modified the command from * 5 * * to * /5 * * ;) Can someone point me to clear instructions or provide some sample files ?
Comments.UserDisplayName: Stefaan H
Tags: <drupal><cron><cron-job><drush>
Title: Running Cron job on Drupal 10 site with CiviCRM 5.79.1
ThreadText: # Running Cron job on Drupal 10 site with CiviCRM 5.79.1
  
  (Asked by: username_0 on 2024-12-01)
  
  When I run this command through SSH, it is executed properly
  
  ```
  drush \
      -l https://www.instituutvlaamsevolkskunst.be \
      --uid=3 \
      civicrm:api job.execute \
      --quiet
  
  ```
  
  When I add it to crontab, nothing happens
  
  ```
  * 5 * * * drush -l https://www.instituutvlaamsevolkskunst.be --uid=3 civicrm:api job.execute --quiet
  
  ```
  
  What am I doing wrong ?
  
  I am following these instructions: <https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#crontab>
  
  username_0
  
  **Tags:** drupal, cron, cron-job, drush
  
  > **Comments:**
  > **username_1**: What unix user does cron run under? Does it have drush in it's PATH? Can also remove the --quiet and add `>> /tmp/drushout.txt 2>> /tmp/drusherr.txt` to get some logging.  
  > **username_2**: As username_1's comment suggests, running a command manually vs. as a cron has some subtle differences (PATH being one), because .. paranoia.  I always include the full path to my drush for that reason (especially because drush "launching" is always tricky because it tries to do a lot of magic stuff like figure out a doc root and base site). For debugging, you can also add a MAILTO line at the top of the crontab so that the errors get sent to you.  
  > **username_0**: tnx, first of all I modified the command from * 5 * * to * /5 * * ;) Can someone point me to clear instructions or provide some sample files ?  
  
  ---
  
  ## 0 answers
  
  