Answers.Body: <p>I just set it up with dreamhost shared hosting.
  I went into cron jobs in my dreamhost control panel and added a new job.
  under command to run I put 
  "/usr/bin/php /home/DREAMHOST-USER/EXAMPLE.COM/wp-content/plugins/civicrm/civicrm/bin/cli.php -u WP-USER -p WP-USER-PASS -e Job -a execute"
  Obviously leave out the quotation marks and change all the sections in CAPITAL letters</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-19T21:12:06.663Z
Answers.Text: Hi @netzih !  Thank you for your comment.  I tried that and unfortunately I got back the following error:  `sh: /usr/bin/php/home/DREAMHOST-USER/WEBSITE.COM/wp-content/plugins/civicrm/civicrm/bin/cli.php: Not a directory`
Answers.UserDisplayName: Brandon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-19T21:44:32.437Z
Answers.Text: I made a change to the directory by taking off the `/usr/bin/php` part and now it's working.  Thank you!!
Answers.UserDisplayName: Brandon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-20T03:19:53.437Z
Answers.Text: Interesting, it seems you did not put a space after /usr/bin/php. That part is just telling the cron where php is located. Than after that space you put the directory which is /home/.....
Answers.UserDisplayName: netzih
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-04T20:43:30.620Z
Answers.Text: Funny you said that, @netzih.  I recently updated CiviCRM which led to a "Permissions Denied" cron error.  I came back to the article and added the `/usr/bin/php ` (note the space) at the beginning.  Now, it's working perfectly again.  So, your fix still works. :)  Thank you!
Answers.UserDisplayName: Brandon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-26T23:05:56.067Z
Answers.LastActivityDate: 2019-09-26T23:05:56.067Z
Answers.UserDisplayName: netzih
Answers.Body: <p>Welcome to SE!  The error includes <code>/bin/sh^M: bad interpreter</code>.  The <code>^M</code> part suggests you created the file on a Windows machine and copied it to your Linux server.  Linux and Windows have different conventions for marking the end of a line.  <a href="https://en.wikipedia.org/wiki/Newline" rel="nofollow noreferrer">See this for more explanation.</a></p>
  
  <p>For are many ways to fix that. If you have ssh to the Linux box try running this to convert the line endings:</p>
  
  <pre><code>dos2unix /home/dh_6x6vh8/civicron.sh
  </code></pre>
  
  <p>There are many other reasons why your cron job might not be working but this should get you past the 'bad interpreter' problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-19T21:45:32.643Z
Answers.Text: Hi, @Aidan !  Thank you for your reply, your insight, and welcome!
Answers.UserDisplayName: Brandon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-27T09:29:18.080Z
Answers.LastActivityDate: 2019-09-27T09:29:18.080Z
Answers.UserDisplayName: Aidan
Body: <p>I'll try to be as thorough as I can while getting straight to the point.
  I am brand new to the idea of using WP-CLI, SSH, and Scheduled Cron jobs.  Everything is Greek to me, so I am in desperate need of help.</p>
  
  <p>I'm trying to remove the System Network Error that's triggered because scheduled cron jobs aren't set up on CiviCRM (v5.17.2).</p>
  
  <p>The site is hosted on Dreamhost (shared server).  I tried following the help documentation on CiviCRM's website (<a href="https://docs.civicrm.org/sysadmin/en/stable/setup/jobs/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/stable/setup/jobs/</a>).  I've completed steps one and two.  The only scheduled job api that's active is the default version check job.  The log came back with a "success" message when I executed it manually.</p>
  
  <p>With step 3, I tried the WP-CLI method since it's a WordPress site.  I tried multiple combinations.  I wasn't sure exactly <em>how</em> to call the job.version_check api.  The instructions said to have a path to wp-cli, so I assumed that it would be to the folder in the plugin.  When I did, I got back a message saying "this is a directory", which I assume was good and it would work (although, I wasn't sure what I was calling since there's just the "civicrm.php" file in the folder).  Reading further in the article, I though I was to have it point to the "cli.php" or the "cron.php" files in the bin directory of the plugin.  Each time, I would get a "permissions denied" message.  I would change the permissions of the files and I would get "no such file or directory" and "command not found" messages, along with the "permissions denied" message.</p>
  
  <p>When I got the "this is a directory" message, I moved on to step 4 and created a scheduled cron job using Dreamhosts' cron scheduler.  I would still get back "permissions denied" messages.  So, I read this article (<a href="https://civihosting.com/blog/how-to-make-a-cron-job-for-civicrm/" rel="nofollow noreferrer">https://civihosting.com/blog/how-to-make-a-cron-job-for-civicrm/</a>) and created a .sh file.  After it was all said and done, this was the last message I got:</p>
  
  <pre><code>sh: /home/dh_6x6vh8/civicron.sh: /bin/sh^M: bad interpreter: No such file or directory
  </code></pre>
  
  <p>Now, I'm stuck and I have no idea what to do or what I'm doing.  I'm sorry for such a long explanation, but I wanted to make sure I was thorough without being too lengthy (which I did more, but it's a long story... if your interested in full details, please reach out).  If there's a wonderful person in this system who can help me, please understand that I'm very new with cron jobs/SSH/CLI/etc, so whatever instructions you give, you'll have to talk to me like a little kid.  Thank you so much for your help!</p>
  
Tags: <wordpress><cron><cron-job>
Title: Very New To Cron - Setting Up Schedule Jobs with Dreamhost
ThreadText: # Very New To Cron - Setting Up Schedule Jobs with Dreamhost
  
  (Asked by: username_0 on 2019-09-26)
  
  I'll try to be as thorough as I can while getting straight to the point.
  I am brand new to the idea of using WP-CLI, SSH, and Scheduled Cron jobs. Everything is Greek to me, so I am in desperate need of help.
  
  I'm trying to remove the System Network Error that's triggered because scheduled cron jobs aren't set up on CiviCRM (v5.17.2).
  
  The site is hosted on Dreamhost (shared server). I tried following the help documentation on CiviCRM's website (<https://docs.civicrm.org/sysadmin/en/stable/setup/jobs/>). I've completed steps one and two. The only scheduled job api that's active is the default version check job. The log came back with a "success" message when I executed it manually.
  
  With step 3, I tried the WP-CLI method since it's a WordPress site. I tried multiple combinations. I wasn't sure exactly *how* to call the job.version\_check api. The instructions said to have a path to wp-cli, so I assumed that it would be to the folder in the plugin. When I did, I got back a message saying "this is a directory", which I assume was good and it would work (although, I wasn't sure what I was calling since there's just the "civicrm.php" file in the folder). Reading further in the article, I though I was to have it point to the "cli.php" or the "cron.php" files in the bin directory of the plugin. Each time, I would get a "permissions denied" message. I would change the permissions of the files and I would get "no such file or directory" and "command not found" messages, along with the "permissions denied" message.
  
  When I got the "this is a directory" message, I moved on to step 4 and created a scheduled cron job using Dreamhosts' cron scheduler. I would still get back "permissions denied" messages. So, I read this article (<https://civihosting.com/blog/how-to-make-a-cron-job-for-civicrm/>) and created a .sh file. After it was all said and done, this was the last message I got:
  
  ```
  sh: /home/dh_6x6vh8/civicron.sh: /bin/sh^M: bad interpreter: No such file or directory
  
  ```
  
  Now, I'm stuck and I have no idea what to do or what I'm doing. I'm sorry for such a long explanation, but I wanted to make sure I was thorough without being too lengthy (which I did more, but it's a long story... if your interested in full details, please reach out). If there's a wonderful person in this system who can help me, please understand that I'm very new with cron jobs/SSH/CLI/etc, so whatever instructions you give, you'll have to talk to me like a little kid. Thank you so much for your help!
  
  **Tags:** wordpress, cron, cron-job
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-09-26. Score: 2 | Accepted answer
  
  I just set it up with dreamhost shared hosting.
  I went into cron jobs in my dreamhost control panel and added a new job.
  under command to run I put
  "/usr/bin/php /home/DREAMHOST-USER/EXAMPLE.COM/wp-content/plugins/civicrm/civicrm/bin/cli.php -u WP-USER -p WP-USER-PASS -e Job -a execute"
  Obviously leave out the quotation marks and change all the sections in CAPITAL letters
  
  > **Comments:**
  > **username_0**: Hi @username_1 !  Thank you for your comment.  I tried that and unfortunately I got back the following error:  `sh: /usr/bin/php/home/DREAMHOST-USER/WEBSITE.COM/wp-content/plugins/civicrm/civicrm/bin/cli.php: Not a directory`  
  > **username_0**: I made a change to the directory by taking off the `/usr/bin/php` part and now it's working.  Thank you!!  
  > **username_1**: Interesting, it seems you did not put a space after /usr/bin/php. That part is just telling the cron where php is located. Than after that space you put the directory which is /home/.....  
  > **username_0**: Funny you said that, @username_1.  I recently updated CiviCRM which led to a "Permissions Denied" cron error.  I came back to the article and added the `/usr/bin/php ` (note the space) at the beginning.  Now, it's working perfectly again.  So, your fix still works. :)  Thank you!  
  
  ---
  
  ### Answer by username_2 on 2019-09-27. Score: 0
  
  Welcome to SE! The error includes `/bin/sh^M: bad interpreter`. The `^M` part suggests you created the file on a Windows machine and copied it to your Linux server. Linux and Windows have different conventions for marking the end of a line. [See this for more explanation.](https://en.wikipedia.org/wiki/Newline)
  
  For are many ways to fix that. If you have ssh to the Linux box try running this to convert the line endings:
  
  ```
  dos2unix /home/dh_6x6vh8/civicron.sh
  
  ```
  
  There are many other reasons why your cron job might not be working but this should get you past the 'bad interpreter' problem.
  
  > **Comments:**
  > **username_0**: Hi, @username_2 !  Thank you for your reply, your insight, and welcome!  
  
  ---
  
  