Jump to content
  • 0

Cron not running


brandon.forerivertech

Question

This is very strange, all other crons are working besides this one. I checked the script (no issues) I can run it manually. However it wont automatically run.

Nothing specific just the entire 

*/5 * * * * /usr/bin/php /home/********/public_html/clients/index.php cron

Is not running.

If this has been encapsulated elsewhere I was unable to find it via a search.

Regards,

Brandon

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

Using apache2, php 7.0.16 on blesta 4.1.2 on Ubuntu.

I also run the cron job with no results or error results although it gets executed each 5min blesta says the cron job run on the time I last ran it manually. Even when running from ssh as: /usr/bin/php -q /var/www/html/billing/index.php cron > /dev/null 2>&1

I then run it again in ssh but without the > /dev/null 2>&1 and receiving the  "error: the ionCube PHP Loader needs to be installed..." although I know it is installed because blesta is working then.

I remember then there is different versions of php, thus running php -i | grep -i 'php.ini' with result:Configuration File (php.ini) Path => /etc/php/7.0/cli  Loaded Configuration File => /etc/php/7.0/cli/php.ini

the ioncube modules is not loaded for php cli, I then added the following at the top of the php.ini file zend_extension = /usr/lib/php/20151012/ioncube_loader_lin_7.0.so

Then when I ran the cron job, it actually gives me the same results as when I run it manually.  I then included the > /dev/null 2>&1  at the end, and since then my cron job problem was sorted.

:-)

 

Link to comment
Share on other sites

  • 0
On 9/12/2016 at 7:51 AM, Allan said:

I had the same problem at first I went and did some digging around and found that if you add /local between /usr/bin it worked.

 

/usr/local/bin/php /home/

permit me to ask Allan. So, i have to add the word "local" in the server cpanel cron job or in the admin setting of blesta? i try in the admin setting of blesta, but it can't be changed.

Link to comment
Share on other sites

  • 0
26 minutes ago, Dany Kurniawan said:

permit me to ask Allan. So, i have to add the word "local" in the server cpanel cron job or in the admin setting of blesta? i try in the admin setting of blesta, but it can't be changed.

What's displayed in Blesta under Settings > System > Automation is the recommended command for setting up your cron. You can't change that. You can copy/paste that into creating a cron job on your server, but you should make sure the path to PHP is correct.

Link to comment
Share on other sites

  • 0
20 minutes ago, Paul said:

What's displayed in Blesta under Settings > System > Automation is the recommended command for setting up your cron. You can't change that. You can copy/paste that into creating a cron job on your server, but you should make sure the path to PHP is correct.

so, i have to delete cron job default when the first time i install blesta? below is the cron job default by blest installation

Capture2.PNG

Link to comment
Share on other sites

  • 0
10 minutes ago, Dany Kurniawan said:

so, i have to delete cron job default when the first time i install blesta? *capture2.png is the default cron job that created by blesta when first time install

 

 

Capture2.PNG

Blesta doesn't create cron jobs (Unless you installed via Softaculous or Installatron?) This looks fine though, assuming cron can find php. Otherwise, you may need to put the full path to php instead. Is it not working? You can see the last run time under Settings > System > Automation.

Link to comment
Share on other sites

  • 0
13 minutes ago, Paul said:

Blesta doesn't create cron jobs (Unless you installed via Softaculous or Installatron?) This looks fine though, assuming cron can find php. Otherwise, you may need to put the full path to php instead. Is it not working? You can see the last run time under Settings > System > Automation.

Yes, i install blesta with Softaculous. Hehehe...
yesterday i realize that cron not run since 1 week. so i decide to run it manually from Settings > System > Automation. Until now, the cron status still showing like this.

Capture3.PNG

until now, it has no change. otherwise, it's been 1 day after i run that cron.

Link to comment
Share on other sites

  • 0
On 12/19/2016 at 4:26 PM, Dany Kurniawan said:

Yes, i install blesta with Softaculous. Hehehe...
yesterday i realize that cron not run since 1 week. so i decide to run it manually from Settings > System > Automation. Until now, the cron status still showing like this.

Capture3.PNG

until now, it has no change. otherwise, it's been 1 day after i run that cron.

I'd suggest trying to run the cron command via SSH as the same user, and see if it works. If it doesn't then your cron may be wrong, if it does, then your cron may not actually be running even though it's set up.

Link to comment
Share on other sites

  • 0
4 hours ago, Chris van der Westhuizen said:

Then when I ran the cron job, it actually gives me the same results as when I run it manually.  I then included the > /dev/null 2>&1  at the end, and since then my cron job problem was sorted.

:-)

 

It is my understanding that ">/dev/null 2>&1" only redirects the output of the script to /dev/null which means you just won't see an error if there was one, not that the script is working as it should. I can suggest running a phpinfo page from the same folder as your blesta install to investigate the location of the php it is using. I'm using Cpanel as well and my php is located at "/opt/alt/php56/usr/bin/php" which I was able to discover after using phpinfo.

Link to comment
Share on other sites

  • 0
On 3/6/2018 at 6:12 PM, S.H. said:

It is my understanding that ">/dev/null 2>&1" only redirects the output of the script to /dev/null which means you just won't see an error if there was one, not that the script is working as it should. I can suggest running a phpinfo page from the same folder as your blesta install to investigate the location of the php it is using. I'm using Cpanel as well and my php is located at "/opt/alt/php56/usr/bin/php" which I was able to discover after using phpinfo.

You are correct about the ">/dev/null 2>&1".  I should have my last sentence to read " at the end, and since then and after doing all of the above my cron job problem was sorted. "  I just removed momentarily the >/dev/null 2>&1 to give me visible results.  :-) thanks

Regarding the php.ini file for the cron job path.  phpinfo from the website returns:

Configuration File (php.ini) Path /etc/php/7.0/apache2
Loaded Configuration File /etc/php/7.0/apache2/php.ini

whereas through ssh command: php -i | grep -i 'php.ini' returns:

Configuration File (php.ini) Path => /etc/php/7.0/cli
Loaded Configuration File => /etc/php/7.0/cli/php.ini

when using the latter path from ssh command my cron job was running correctly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...