Answers.Body: <p>Welcome to SE!  Setting up cron can be confusing since there are many variations and it touches several aspects: OS users &amp; permissions, CMS users &amp; permissions, other tools, cron - and the details depend on your hosting environment.</p>
  
  <p>I've just re-read the page you linked to.  It has the information you need, but it also has other options that you don't need, so work through that step by step.  (I've also submitted a few clarifications.)</p>
  
  <p>So, following the '<a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#preparing" rel="nofollow noreferrer">Preparing</a>' section and assuming a typical Ubuntu installation:</p>
  
  <ol>
  <li>Choose a command:  I prefer the <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv" rel="nofollow noreferrer">cv method</a></li>
  <li>OS User: Ubuntu typically uses 'www-data' to run Apache. (Adjust below if different.)</li>
  <li>CMS User: Create a Drupal user (eg 'cronuser') with <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#choosing-a-cms-user" rel="nofollow noreferrer">the listed permissions</a></li>
  </ol>
  
  <p>If you don't have <a href="https://github.com/civicrm/cv" rel="nofollow noreferrer">cv</a> installed already, go ahead and install it.</p>
  
  <p>Check that you can run the command manually:</p>
  
  <pre><code>$ sudo -u www-data cv api job.execute --user=cronuser --cwd=/var/www/html
  </code></pre>
  
  <p>(If your installation is not under /var/www/html adjust accordingly)</p>
  
  <p>Then add it to the crontab for <code>www-data</code>:</p>
  
  <pre><code>$ sudo crontab -e -u www-data
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-17T14:35:10.053Z
Answers.Text: Thanks Aidan. That proved incredibly helpful.
Answers.UserDisplayName: Daniel Ludlow
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-18T16:04:11.897Z
Answers.Text: Great!  Now that you've gone through the process, if there are clarifications you can add to the documentation then do submit an update.  It's easy to submit updates with the 'single change' method - https://docs.civicrm.org/user/en/latest/the-civicrm-community/contributing-to-this-manual/#single_changes
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-07T17:02:56.887Z
Answers.Text: This is great and very clear. To install **cv**, I only had to issue two commands: `sudo curl -LsS https://download.civicrm.org/cv/cv.phar -o /usr/local/bin/cv` and `sudo chmod +x /usr/local/bin/cv`
Answers.UserDisplayName: Pierre François
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-15T09:17:14.380Z
Answers.LastActivityDate: 2019-10-15T09:17:14.380Z
Answers.UserDisplayName: Aidan
Body: <p>I have created a test instance of CiviCRM that uses Drupal 7 as the CMS. It's running inside a Ubuntu Desktop virtual machine that has a LAMP stack installed on it (Apache2, php7.2 and mySQL).</p>
  
  <p>I am very new to Linux and would like to set up a cron job to run CiviCRM's scheduled tasks. I have looked at <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/</a>, but I confess that I find it confusing. I haven't set up any cron jobs for Drupal, either. Can anyone help me, please?</p>
  
  <p>Many thanks in advance,</p>
  
  <p>Daniel</p>
  
Tags: <drupal><installation><cron>
Title: What is the easiest way to set up cron for CiviCRM on a Drupal 7 installation?
ThreadText: # What is the easiest way to set up cron for CiviCRM on a Drupal 7 installation?
  
  (Asked by: username_0 on 2019-10-09)
  
  I have created a test instance of CiviCRM that uses Drupal 7 as the CMS. It's running inside a Ubuntu Desktop virtual machine that has a LAMP stack installed on it (Apache2, php7.2 and mySQL).
  
  I am very new to Linux and would like to set up a cron job to run CiviCRM's scheduled tasks. I have looked at <https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/>, but I confess that I find it confusing. I haven't set up any cron jobs for Drupal, either. Can anyone help me, please?
  
  Many thanks in advance,
  
  Daniel
  
  **Tags:** drupal, installation, cron
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-15. Score: 4 | Accepted answer
  
  Welcome to SE!  Setting up cron can be confusing since there are many variations and it touches several aspects: OS users & permissions, CMS users & permissions, other tools, cron - and the details depend on your hosting environment.
  I've just re-read the page you linked to.  It has the information you need, but it also has other options that you don't need, so work through that step by step.  (I've also submitted a few clarifications.)
  So, following the 'Preparing' section and assuming a typical Ubuntu installation:
  
  Choose a command:  I prefer the cv method
  OS User: Ubuntu typically uses 'www-data' to run Apache. (Adjust below if different.)
  CMS User: Create a Drupal user (eg 'cronuser') with the listed permissions
  
  If you don't have cv installed already, go ahead and install it.
  Check that you can run the command manually:
  $ sudo -u www-data cv api job.execute --user=cronuser --cwd=/var/www/html
  
  (If your installation is not under /var/www/html adjust accordingly)
  Then add it to the crontab for www-data:
  $ sudo crontab -e -u www-data
  
  > **Comments:**
  > **username_0**: Thanks username_1. That proved incredibly helpful.  
  > **username_1**: Great!  Now that you've gone through the process, if there are clarifications you can add to the documentation then do submit an update.  It's easy to submit updates with the 'single change' method - https://docs.civicrm.org/user/en/latest/the-civicrm-community/contributing-to-this-manual/#single_changes  
  > **username_2**: This is great and very clear. To install **cv**, I only had to issue two commands: `sudo curl -LsS https://download.civicrm.org/cv/cv.phar -o /usr/local/bin/cv` and `sudo chmod +x /usr/local/bin/cv`  
  
  ---
  
  