Jump to content
  • 0

Cron Jobs


dboutell

Question

I am a completely new user. I managed to get the software loaded and running, I think.  Installation instructions said to set the cron jobs to run every 5 minutes. I went to the demo on blesta and looked at their automation settings. It looks like the settings from installation are pretty close to the same. I remember a cron key, which I had no idea about where to put it. Cron only works manually. There must be so much more that I need to do that I have no clue about. Help.

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

I am very sorry.  I do not think that you are a bastard at all. The problem all along has been that the link that you posted in the beginning did not have the information that came in your last post.

 

Namely:  

 

Enter this into the cron line command:

 

*/5 * * * * /usr/local/bin/php /home/YOUR-CPANEL-ACCOUNT-NAME/public_html/index.php cron

 

Replace YOUR-CPANEL-ACCOUNT-NAME with your actual cPanel account name before submitting the command.

 

If it did, I probably wouldn't have seemed like such a block head. 

 

Thank you for your time.

Link to comment
Share on other sites

  • 0

if you have problem to set command cron than you can set web cron ,it is much easyer to set it and it run every where,this is great alternative if someone has account with provider who don't allow crons executed every 5 minutes so you can set external cron from other provider but it also can be used in case you can't set  command cron.

Insted puting that comand put this 

GET http://yourdomain.com/blesta_dir/cron/?cron_key=your cron key

Insted yourdomain.com set your domain and insted blesta_dir put blesta installation foldler and insted your_cron_key put your kron key.

Cron key can be seen or generated in settings-->sistem-->automation

_You can set even external backup cron that run every few hours just in case,,there is much provider who offer even free cron jobs executed 15 minutes or more.

i'm not sure why you can't set cron properly for Blesta,it isn't rare case but most often it is due wrong path or command is not copy/paste properly(without space after command or two time space..etc)Yoo coud ask S5 support ,they have access to error log and they can help you

Link to comment
Share on other sites

  • 0

Site5 is asking which version of php is required for the cron job.

 

It sounds like you're running PHP 5.3 now, so 5.3 or 5.4 would be fine. Blesta 4.0 will have a minimum requirement of PHP 5.4, so you may want to go that route. Also, if this cron task is being created in cPanel, then you can ignore the first bit "*/5 * * * * " if using the simple editor and just set it to run every 5 minutes. You can be sure it's working if the last ran date updates every 5 minutes under Settings > System > Automation.

Link to comment
Share on other sites

  • 0

I believe that I  have Blesta 6.3.  It has not ran. Everything, even the 5 minute items show yesterday when i ran it manually.

 

The latest version of Blesta is 3.6.1 (out just now) I can check what version you're running if you PM me your license key. If it shows it last ran yesterday, then it's not running properly. What are you currently using for your cron command and what does it say you should use under Settings > System > Automation?

Link to comment
Share on other sites

  • 0

Cron command in cpanel

 

/usr/local/php53/bin/php /home/dboutell/public_html/blesta/index.php

I have no idea why I even decided to reply one more time but the correct command was given last night. Scroll up the page and READ it.

 

*/5 * * * * /usr/local/bin/php /home/dboutell/public_html/blesta/index.php cron

Link to comment
Share on other sites

  • 0

uner the question mark is:  It says be sure to point the cron command to where php is installed if it differs from what is shown

Copy this code:

 

*/5 * * * * /usr/local/bin/php /home/dboutell/public_html/blesta/index.php cron

 

Login to cPanel, go to cron jobs and paste the code in the field that says 'Command', then click the button that says 'Add New Cron Job'. It's as simple as that and you don't have to read every little thing and question it.

 

It can not be explained any easier than this and that is all you need to do and all you need to worry about.

Link to comment
Share on other sites

  • 0

This slowly became comic

 

Copy paste from sit5 KB

 

1) Click the Cron Jobs icon
cp_cron_1-300x168.png

2) Enter the email address where you want the cron job results sent after each time it runs
cp_cron_2-300x168.png

3) Now you have to define exactly when and how often you want the cron job to run. This is made easier by using one of the pre-defined or common settings
cp_cron_3-300x168.png

Notice that by choosing a common setting, all fields are filled in automatically. This also helps you understand what each field means
cp_cron_4-300x168.png

4) Let’s choose Once a week
cp_cron_5-300x168.png

5) Next, enter the command of the script you want to run, including the path (from root)
cp_cron_6-300x168.png

 

Note: Remember to prefix the path with the binary you wish to use to run your script. For example, if you wanted to run a PHP script using the default version of PHP, you would enter the following before your path…

“/usr/bin/php ”

If you wanted to use a different version of PHP (e.g. 5.2,), make sure you use the correct binary (“/usr/local/php52/bin/php”) for your needed version. You can find most binary paths 
.

Remember to add a space between the binary and the path. In the example below note the space between ‘php’ and ‘/home’.

“/usr/bin/php /home/username/script.php”

6) When ready, click Add New Cron Job
cp_cron_7-300x168.png

That’s it! The cron job has been set as you can see here. You can create additional cron jobs, and edit or delete existing ones
cp_cron_8-300x168.png

Link to comment
Share on other sites

  • 0

Yes, real comic, except for the fact that it didn't work. I'm still waiting to find out from Site5 they did to make it work.

Did you try web cron I advice you in previos post,...just to say that it is posible that you do everything right from client side and cron is still not executed.I had few times situation myself in cPanel case(not related to blesta) but in that case only server admin can resolve it.Here is once again solution which will work same job but it will not depend from binary paths,php version,php conf..etc(Luckly Blesta support web cron also)

 

Insted puting that comand put this Set execution time same as for php cron ,every 5 minutes.

GET http://yourdomain.com/blesta_dir/cron/?cron_key=your_cron_key

For example my woud be(offcourse key is random)

GET https://nelsahost.com/billing/?cron_key=gfkkphrnghkt

Insted yourdomain.com set your domain and insted blesta_dir put blesta installation foldler and insted your_cron_key put your kron key.

Cron key can be seen or generated in settings-->sistem-->automation

 

You can use this all the time or just till find why cron is not executed.You can visit that url in your broswer and if url and key is right you will see every tasks executed.

Link to comment
Share on other sites

  • 0

Thank you Nelsa for sticking with me on this.

 

Site5 told me this is what they did to make it work. 

 

We manually changed your user's shell from "/usr/local/cpanel/bin/noshell" to "/bin/bash" which fixed your cronjobs. You should be able to enable the user shell by default when creating your accounts from WHM or while creating your account packages.

 

I got that information about 10 p.m. last night

 

 I have been watching Settings --> System --> Automation to determine if the cron job, which Site5 got going about 4:30 yesterday afternoon, was running or not.  From 4:30 to about 11:30 when I went to bed,  Settings --> System --> Automation indicated that the cron job was not working, even when clearing the cache on 3 different browsers, or checking the mailbox where the report is also supposed to go. 

 

Today I was going to ask why Settings --> System --> Automation did not work for showing if the cron was working. But before I asked I decided that I'd better check it. To my surprise, it is working. Now I have to ask why did it start working? 

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