Answers.Body: <p>In order to close this post, I'll explain the solution.
  There were 2 mistakes:
  1/ the parametre cwd= (current working directory)  was incorrect.
  2/ the way I use UIHostinger for cron was incorect.</p>
  <p>My solution is:
  <code>0,30 * * * *   /usr/bin/php /home/u781989671/public_html/wp-content/plugins/civicrm/civicrm/bin/cv.phar api job.execute --user=myuser --cwd=/home/u781989671/public_html</code></p>
  <p>best regards,
  rv</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-03T19:59:59.983Z
Answers.LastActivityDate: 2021-01-03T19:59:59.983Z
Answers.UserDisplayName: rv91530
Body: <p>I'm running CiviCRM 5.32.0 on WordPress 5.6 hosted by Hostinger.</p>
  <p>1st step I test cv.phar =
  php /xzy/wp-content/plugins/civicrm/civicrm/bin/cv.phar api Job.process_mailing --user=abcd --cwd=/xyz</p>
  <p>2nd step I test a script using that command with the same result OK =
  bash civicron_2.sh
  {
  &quot;is_error&quot;: 0,
  &quot;version&quot;: 3,
  &quot;count&quot;: 1,
  &quot;id&quot;: &quot;processed&quot;,
  &quot;values&quot;: {
  &quot;processed&quot;: 0
  }
  }</p>
  <p>3nd step, I created the cron rule in Hostinger panel (every 30 minutes) =
  0,30 * * * *    /usr/bin/php /xyz/abcd/civicron_2.sh</p>
  <p>But finaly CiviCRM UI says : &quot;no cron job is running&quot; and the only way I succed to run Job is manually on the CiviCRM UI.</p>
  <p>I need advice to go further.
  BR hervé</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T08:51:15.230Z
Comments.Text: I tried the wp-cli methode with the same result = -bash-4.1$ /xzy/wp-content/plugins/civicrm/civicrm/bin/wp-cli.phar --user=abcd --url=https://cycloclubbreuillet.fr --cwd=/xzy civicrm api job.execute auth=0
  Array
  (
      [is_error] => 0
      [version] => 3
      [count] => 1
      [values] => 1
  )
Comments.UserDisplayName: rv91530
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T13:48:21.117Z
Comments.Text: You'll need to figure out where the error is being captured. Since it looks like you're using the system cron, the error will likely be in /var/log/syslog. However, since you have a hosted account, I'm not really sure exactly where. I am confident however, that there will be useful information from cron in the log.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T14:58:35.853Z
Comments.Text: I reply to myself to explain the first part of my solution: **the current working directory was incorrect**.
  Using wp-cli methode the parametre of --cwd= must not be the directory where index.php of the website is located (in my case /home/u781989671/public_html/) but the directory where all directories of the website are located (in my case /home/u781989671/)
  Now, when I run the new script in command-line PuTTY, I can see in UI CiviCRM that cron has been executed.
  The second part of the solution has to be found with suport Hostinger.
  I created a rule in UI Hostinger but noting happens.
Comments.UserDisplayName: rv91530
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T16:44:37.157Z
Comments.Text: Ok, I solve the second part of the solution: I have to put the command directly in the Hostinger cron panel and not the path to file including the command. best regards rv
Comments.UserDisplayName: rv91530
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-02T19:12:12.937Z
Comments.Text: CiviCRM will tell you "cron is not running" unless your cron calls "Job.execute". Calling a specific job like "Job.process_mailing" is OK, but it will not appear in the Scheduled Jobs Log and CiviCRM will not see it as "cron is running".
Comments.UserDisplayName: Noah Miller
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-02T19:13:34.713Z
Comments.Text: If you have found a solution that you're satisfied with, please post it as an answer.
Comments.UserDisplayName: Noah Miller
Tags: <cron><cron-job>
Title: Command are running manually, but cron is not running
ThreadText: # Command are running manually, but cron is not running
  
  (Asked by: username_0 on 2020-12-30)
  
  I'm running CiviCRM 5.32.0 on WordPress 5.6 hosted by Hostinger.
  
  1st step I test cv.phar =
  php /xzy/wp-content/plugins/civicrm/civicrm/bin/cv.phar api Job.process\_mailing --user=abcd --cwd=/xyz
  
  2nd step I test a script using that command with the same result OK =
  bash civicron\_2.sh
  {
  "is\_error": 0,
  "version": 3,
  "count": 1,
  "id": "processed",
  "values": {
  "processed": 0
  }
  }
  
  3nd step, I created the cron rule in Hostinger panel (every 30 minutes) =
  0,30 \* \* \* \* /usr/bin/php /xyz/abcd/civicron\_2.sh
  
  But finaly CiviCRM UI says : "no cron job is running" and the only way I succed to run Job is manually on the CiviCRM UI.
  
  I need advice to go further.
  BR hervé
  
  **Tags:** cron, cron-job
  
  > **Comments:**
  > **username_0**: I tried the wp-cli methode with the same result = -bash-4.1$ /xzy/wp-content/plugins/civicrm/civicrm/bin/wp-cli.phar --user=abcd --url=https://cycloclubbreuillet.fr --cwd=/xzy civicrm api job.execute auth=0 Array (     [is_error] => 0     [version] => 3     [count] => 1     [values] => 1 )  
  > **username_1**: You'll need to figure out where the error is being captured. Since it looks like you're using the system cron, the error will likely be in /var/log/syslog. However, since you have a hosted account, I'm not really sure exactly where. I am confident however, that there will be useful information from cron in the log.  
  > **username_0**: I reply to myself to explain the first part of my solution: **the current working directory was incorrect**. Using wp-cli methode the parametre of --cwd= must not be the directory where index.php of the website is located (in my case /home/u781989671/public_html/) but the directory where all directories of the website are located (in my case /home/u781989671/) Now, when I run the new script in command-line PuTTY, I can see in UI CiviCRM that cron has been executed. The second part of the solution has to be found with suport Hostinger. I created a rule in UI Hostinger but noting happens.  
  > **username_0**: Ok, I solve the second part of the solution: I have to put the command directly in the Hostinger cron panel and not the path to file including the command. best regards rv  
  > **username_2**: CiviCRM will tell you "cron is not running" unless your cron calls "Job.execute". Calling a specific job like "Job.process_mailing" is OK, but it will not appear in the Scheduled Jobs Log and CiviCRM will not see it as "cron is running".  
  > **username_2**: If you have found a solution that you're satisfied with, please post it as an answer.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-01-03. Score: 2
  
  In order to close this post, I'll explain the solution.
  There were 2 mistakes:
  1/ the parametre cwd= (current working directory) was incorrect.
  2/ the way I use UIHostinger for cron was incorect.
  
  My solution is:
  `0,30 * * * * /usr/bin/php /home/u781989671/public_html/wp-content/plugins/civicrm/civicrm/bin/cv.phar api job.execute --user=myuser --cwd=/home/u781989671/public_html`
  
  best regards,
  rv
  
  
  ---
  
  