Answers.Body: <p>You don't say what version of anything you are running, or if you upgraded or did a new install.  If this is a 4.7 upgrade, I had similar issues and had to resort to installing and using the WP-CLI method.  If you go that route, you probably also want to take a look at this:
  <a href="https://civicrm.stackexchange.com/questions/9553/wp-cli-using-gmt-utc-timezone-on-cron-jobs?rq=1">WP-CLI using GMT/UTC Timezone on cron jobs</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-01T15:18:18.703Z
Answers.Text: Sorry, slipped my mind to include the versions, I might have to resort to WP-CLI, thank you for the suggestion.
  
  Using:
  cPanel version 11.52.3 (build 1)
  CiviCRM version 4.6
  WordPress 4.4.2
Answers.UserDisplayName: LJB
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-29T19:31:06.093Z
Answers.LastActivityDate: 2016-02-29T19:31:06.093Z
Answers.LastEditDate: 2017-04-13T12:53:13.017Z
Answers.UserDisplayName: G H
Answers.Body: <p>Not sure if I'm on the right track here, but what if you created a separate one-liner script with just the wget command you're trying to run and executed said script from cron?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-01T15:19:36.773Z
Answers.Text: Good idea, I have tried it, for some reason Cron always reports back saying no such file or directory. I am still trying many things and this idea has not been crossed off just yet.
Answers.UserDisplayName: LJB
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-29T22:39:05.557Z
Answers.LastActivityDate: 2016-02-29T22:39:05.557Z
Answers.UserDisplayName: B L
Body: <p>I have spent the last two weeks trying to get Cron Jobs with cPanel run Scheduled Jobs in CiviCRM. Literally everything I have tried does not work as a command in Cron Jobs but when using SSH I have been able to get this to trigger the job to run:</p>
  
  <pre><code>wget -q -O - "http://website.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=websiteAdmin&amp;pass=websiteAdminPassword&amp;key=1234567912345678912345678912345"
  </code></pre>
  
  <p>But when I take this exact command that works via SSH and put it into Cron Jobs I get an email stating:</p>
  
  <pre><code>/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
  /bin/sh: -c: line 1: syntax error: unexpected end of file
  </code></pre>
  
  <p>My next idea was to remove the quotation marks before and after the link, which then failed due to invalid token, the password has symbols in it, so I escaped them using \ before each special character. Then I get:</p>
  
  <pre><code>ERROR: You need to send a valid key to execute this file. More info at:http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs
  </code></pre>
  
  <p>At this point, I know for a fact the key is correct since this command runs via SSH and the key never changed every time so far. The escaped characters are only within the password.</p>
  
  <p>I have tried many other things but I figured a log file explanation might be overkill, anyone have any ideas?</p>
  
  <p>Using:
  cPanel version 11.52.3 (build 1)
  CiviCRM version 4.6
  WordPress 4.4.2</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-29T19:44:30.587Z
Comments.Text: Have you tried escaping also the ampersand characters in the string? ie. `\&pass...\&key...`
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-01T14:31:02.850Z
Comments.Text: Yes, when I escape the additional characters after the ? I get: 
  
  `ERROR: You need to send a valid user name and password to execute this file`
  
  That was a good idea, I thought for sure it would solve it too.
  
  Using:
  cPanel version 11.52.3 (build 1)
  CiviCRM version 4.6
Comments.UserDisplayName: LJB
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-01T16:31:40.563Z
Comments.Text: When I was testing this, it seemed that system checked the key before it checked the Username/Password.  You could quick test this theory by escaping things and entering the wrong key.  A return of invalid key would then show the key is being tested first.  This is the reason I ended up having to go to WP-CLI.  I was getting the same type of errors with curl.
Comments.UserDisplayName: G H
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-04T16:35:30.557Z
Comments.Text: I have been working towards getting WP-CLI to do the job for me and have run into another issue.
  
  When doing this command 
  
  `wp eval-file http://website.org/wp-content/plugins/civicrm/civicrm/bin/cron.php name=websiteAdmin pass=websiteAdminPassword key=1234567912345678912345678912345 --path=/home8/farrnetw/public_html/`
  
  It returns:
  
  `Fatal error: Class 'WP_Widget' not found in /home8/thing/public_html/wp-content/plugins/image-widget/image-widget.php on line 25`
  
  I did som checking around and all I can find is people having install issues, which is not the case here since this has been up
Comments.UserDisplayName: LJB
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-07T15:30:32.050Z
Comments.Text: Solved the issue, used this line to get it to run
  `wget -O /dev/null -q -t 1 'http://website.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=web_admin&pass=web_pass&key=web_key'` but i had to only escape a % symbol that was in the password and not escape any of the other special characters.
Comments.UserDisplayName: LJB
Tags: <wordpress><cron><scheduled-job>
Title: cPanel Cron to run Scheduled Job Help
ThreadText: # cPanel Cron to run Scheduled Job Help
  
  (Asked by: username_0 on 2016-02-29)
  
  I have spent the last two weeks trying to get Cron Jobs with cPanel run Scheduled Jobs in CiviCRM. Literally everything I have tried does not work as a command in Cron Jobs but when using SSH I have been able to get this to trigger the job to run:
  wget -q -O - "http://website.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=websiteAdmin&pass=websiteAdminPassword&key=1234567912345678912345678912345"
  
  But when I take this exact command that works via SSH and put it into Cron Jobs I get an email stating:
  /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
  /bin/sh: -c: line 1: syntax error: unexpected end of file
  
  My next idea was to remove the quotation marks before and after the link, which then failed due to invalid token, the password has symbols in it, so I escaped them using \ before each special character. Then I get:
  ERROR: You need to send a valid key to execute this file. More info at:http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs
  
  At this point, I know for a fact the key is correct since this command runs via SSH and the key never changed every time so far. The escaped characters are only within the password.
  I have tried many other things but I figured a log file explanation might be overkill, anyone have any ideas?
  Using:
  cPanel version 11.52.3 (build 1)
  CiviCRM version 4.6
  WordPress 4.4.2
  
  **Tags:** wordpress, cron, scheduled-job
  
  > **Comments:**
  > **username_1**: Have you tried escaping also the ampersand characters in the string? ie. `\&pass...\&key...`  
  > **username_0**: Yes, when I escape the additional characters after the ? I get:   `ERROR: You need to send a valid user name and password to execute this file`  That was a good idea, I thought for sure it would solve it too.  Using: cPanel version 11.52.3 (build 1) CiviCRM version 4.6  
  > **username_2**: When I was testing this, it seemed that system checked the key before it checked the Username/Password.  You could quick test this theory by escaping things and entering the wrong key.  A return of invalid key would then show the key is being tested first.  This is the reason I ended up having to go to WP-CLI.  I was getting the same type of errors with curl.  
  > **username_0**: I have been working towards getting WP-CLI to do the job for me and have run into another issue.  When doing this command   `wp eval-file http://website.org/wp-content/plugins/civicrm/civicrm/bin/cron.php name=websiteAdmin pass=websiteAdminPassword key=1234567912345678912345678912345 --path=/home8/farrnetw/public_html/`  It returns:  `Fatal error: Class 'WP_Widget' not found in /home8/thing/public_html/wp-content/plugins/image-widget/image-widget.php on line 25`  I did som checking around and all I can find is people having install issues, which is not the case here since this has been up  
  > **username_0**: Solved the issue, used this line to get it to run `wget -O /dev/null -q -t 1 'http://website.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=web_admin&pass=web_pass&key=web_key'` but i had to only escape a % symbol that was in the password and not escape any of the other special characters.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2016-02-29. Score: 1
  
  You don't say what version of anything you are running, or if you upgraded or did a new install. If this is a 4.7 upgrade, I had similar issues and had to resort to installing and using the WP-CLI method. If you go that route, you probably also want to take a look at this:
  [WP-CLI using GMT/UTC Timezone on cron jobs](https://civicrm.stackexchange.com/questions/9553/wp-cli-using-gmt-utc-timezone-on-cron-jobs?rq=1)
  
  > **Comments:**
  > **username_0**: Sorry, slipped my mind to include the versions, I might have to resort to WP-CLI, thank you for the suggestion.  Using: cPanel version 11.52.3 (build 1) CiviCRM version 4.6 WordPress 4.4.2  
  
  ---
  
  ### Answer by username_3 on 2016-02-29. Score: 0
  
  Not sure if I'm on the right track here, but what if you created a separate one-liner script with just the wget command you're trying to run and executed said script from cron?
  
  > **Comments:**
  > **username_0**: Good idea, I have tried it, for some reason Cron always reports back saying no such file or directory. I am still trying many things and this idea has not been crossed off just yet.  
  
  ---
  
  