Jump to content
  • 0

Having Trouble Getting Cron Set Up On Control Panel


Jason Ryan

Question

Hello -

I am having a little bit of an issue properly configuring Cron to run via Control Panel. If I run it manually from the dashboard it is able to run fine, however after working with Support from my Hosting provider, we tried setting it up last night and it never ran today.

This is the requirements via CP:

- In case you use a PHP cron script, please set its first line to: #!/usr/local/bin/php.cli
- You must set read and execute permissions (like 775) to your script, to be able to run it.
- The script must be saved with Unix-style end-of-lines.
- Any script output will be sent to the specified e-mail address, if the option is enabled. No e-mail is sent when you run the script manually.
- A script can be added only once.
- A single crontab job can be run maximum four times per hour.

They only allow it to run every 15 minutes, and rightfully so since I am on a Shared Hosting plan, but following their instructions since this seems to be a little bit of a different setup from any documentation I could find, I am a little perplexed to say the least.

I had added the "#!/usr/local/bin/php.cli" to Line 1 of the index.php file inside the root Blesta directory, changed its permissions to 775. Then from the Crontab I have it pointing to this file and set it to run every 15 minutes but to no avail. What am I missing here?

Thanks.

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

You can execute cron through url till you solve issue..in fact you can use it forever...there is no difference..when it comes to result  and what is important.it will work everywhere.. ,this would be cron command....

GET https://yoururl.com/blesta_dir/cron/?cron_key=PUT_HERE_CRON_KEY

 Just change url,blesta_dir and cron key
Cron key can be found in blesta settings->system->automation

Just to be clear thjis cron can be set on different server,hosting account you have with other provider,third party cron provider....etc and it will work at same way.

 

 

Here is free cron provider https://cron-job.org/

You can set cron even every minute...so you can use  command above and set there every 5 minute unlike every 15 on your hosting account.

Link to comment
Share on other sites

  • 0

 Forgot to click the "Follow Topic" button....

Anyway, decided to sign up for EasyCron instead, have it set up using the URL method @Nelsa mentioned above, however my Dashboard is still telling me that it isn't running? Bug? Cache?
 

GET https://support.mydomainname.com/cron/?cron_key=PUT_HERE_CRON_KEY

Just checked, it is running every 5 minutes like it is supposed to so why is my dashboard still yelling at me?

 

Thanks.

Link to comment
Share on other sites

  • 0

 Forgot to click the "Follow Topic" button....

Anyway, decided to sign up for EasyCron instead, have it set up using the URL method @Nelsa mentioned above, however my Dashboard is still telling me that it isn't running? Bug? Cache?

 

GET https://support.mydomainname.com/cron/?cron_key=PUT_HERE_CRON_KEY

Just checked, it is running every 5 minutes like it is supposed to so why is my dashboard still yelling at me?

 

Thanks.

 

What does it say for the last run time under Settings > System > Automation? What is the exact error you're getting on the dashboard's system status widget? It's possible some tasks are running and not others. You can check which tasks specifically are running under Settings > Company > Automation. Make sure they are enabled, and not hanging. If a task hangs, it could be because it's encountering an error.

Link to comment
Share on other sites

  • 0

What does it say for the last run time under Settings > System > Automation? What is the exact error you're getting on the dashboard's system status widget? It's possible some tasks are running and not others. You can check which tasks specifically are running under Settings > Company > Automation. Make sure they are enabled, and not hanging. If a task hangs, it could be because it's encountering an error.

 

Paul -

I ran it manually this morning after setting it up through EasyCron and it is showing that is when it was last run under Settings -> System -> Automation

The cron last ran on Jun 22, 2016 9:39:59 AM.

Prior to that the message on the dashboard was saying that it hadn't run in the last 24 hours, this was showing even after I set up EasyCron and it had ran several times, it just wasn't reflecting within the dashboard, and still doesn't. I am not receiving any errors and I am still in the process of setting up everything so there are not any real tasks running as of yet. (I think)

Link to comment
Share on other sites

  • 0

Ok, got it sorted out I think. I regenerated a new Cron Key and ran the URL version in the browser and Cron ran successfully. Then deleted the old Cron Job over at EasyCron and entered the new one with the updated key and it seems to be running fine now. Now I am thinking it was a Cache issue. I'll keep my eye on it and report back if anything changes.

Thanks again for the help! Much appreciated.

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...