Jump to content
  • 0

Question

Hi, I'm having a little trouble running my cronjob via scheduled tasks in Plesk

I am running Blesta 4.0.1

 

This is my scheduled task list

 

/usr/bin/php /var/www/vhosts/****.com/httpdocs/clients/index.php cron

 

 

I set it at every 5 minutes, everyday, every week/month, but it doesnt seem to run :(, anyone else have a prob like mine?

Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
20 minutes ago, SowWun said:

Hi, I'm having a little trouble running my cronjob via scheduled tasks in Plesk

I am running Blesta 4.0.1

 

This is my scheduled task list

 

/usr/bin/php /var/www/vhosts/****.com/httpdocs/clients/index.php cron

 

 

I set it at every 5 minutes, everyday, every week/month, but it doesnt seem to run :(, anyone else have a prob like mine?

Im not sure about plesk but with cpanel you have to change it to /usr/local/bin/php /var/www/vhosts/***.com/httpdocs/clients/index.php cron >/dev/null 2>&1 try this. Worth a try im sorry if I couldn't be helpful

Link to post
Share on other sites
  • 0

Thanks ! My plesk is the webadmin edition, I dont see a fetch URL button, but instead i used this command :

curl -k https://***.com/clients/cron/?cron_key=DEARR7nW

It seems to go okay ( No error log message ), but instead, I get this message :

  

Quote

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

 

Link to post
Share on other sites
  • 0

I cant edit the post, but an update ~ 

 

I ran this command 

wget --no-check-certificate https://****.com/clients/cron/?cron_key=DEARR7nW

 

And I got this as a log file :

Quote

--2017-09-11 07:50:01--  https://****.com/clients/cron/?cron_key=DEARR7nW
Resolving ****.com... ****.61
Connecting to ****.com|1****.61|:443... connected.
WARNING: cannot verify hostkoala.com’s certificate, issued by “/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA”:
  Unable to locally verify the issuer’s authority.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://****.com/clients/ [following]
--2017-09-11 07:50:02--  https://****.com/clients/
Reusing existing connection to ****.com:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “index.html?cron_key=DEARR7nW.1”

But I dont think it ran as I cant see any logs from activity log from Blesta interface tho :(

Link to post
Share on other sites
  • 0

If there is no fetch URL than jzst put GET in front..and it will work...I didn't know that plesk web edition doesn't have fetch as URL option,but this will work...also in cPanel it should be set as this if you want run cron at this way.

GET https://***.com/clients/cron/?cron_key=DEARR7nW

Link to post
Share on other sites
  • 0

Also I think you didn't install root  certificate from comodo,in most case this will not be issue but some browser(many mobile )will not recognize it and i think that is reason why Plesk can't verify SSL.You should always upload 3 files(or copy/paste in 3 fields) when installing SSL..one is  key,second your domain SSl and third intermediate root certificate from authority,this last can be downloaded from vendor website

Link to post
Share on other sites
  • 0

Hmm, I rechecked my cert and i did upload all parts, however I didn't install some perl module ( Crypt::SSLeay ), I did that, and everything seems smooth and fine

Now I think it is working when I use 

Quote

GET https://***.com/clients/cron/?cron_key=DEARR7nW

but my cron reports sends me a full html page of my blesta portal page XD, sorry for being a newbie.. super confused :(

Link to post
Share on other sites
  • 0

Your problem is not cron I just visited https://hostkoala.com/clients/cron/?cron_key=DEARR7nW  and insted executing cron it redirect me to https://hostkoala.com/clients and that is why your cron is not executed from web ,you have rule that redirect  all urls that doesn't exist to home page and it redirect also your cron url...now this url shouldn't be redirected..are you sure it is right key...When you visit that cron url in web browser you should see how cron is executed and this when done

Attempting to run all tasks for Nelsahost web hosting service.
All tasks have been completed.
Attempting to run all system tasks.
All system tasks have been completed.

 

This is from my cron url,I'm running cron at this way for years....

You should check is that your key....you can try update cron key and than copy new one so you can try,this can happen only if cron key is wrong or there is some issue with .htaccess configuration..

Link to post
Share on other sites
  • 0

*** Update to the below solution, I thought it was working, it still may with some tweaking but I spent enough time with trial and error.

Best way really is to use the Cron Key generated from Blesta and Fetch Command within your plesk scheduled tasks

Works perfectly and allows you to use other services such as EasyCron

=== (As Nelsa mentioned within this thread)

You can set cron to https://****.com/clients/cron/?cron_key=your-cron-key 

And check "fetch URL"

Change your-cron-key to key you can find in settings-->system-->automation-->update cron key

===

Albeit this question is a bit old, some may find this helpful.

Plesk Web Admin Edition running Blesta run every 5 min

Tools Settings / Scheduled Tasks (create new Cron Job)

/opt/psa/admin/bin/php -q/var/www/vhosts/YourDomain.xxx/httpdocs/index.php cron  > /dev/null 2>&1

(Make sure there is "no" space between the php -q and /var as noted above) 

(above assumes default location of public files httpdocs)

(Your location of php may vary depending on your hosting provider, or server install)

Use Cron Style for the "Run" : */5 * * * * 

Will setup for every 5 min, every day, 365 days per year

Apply and Run (for test) should execute with green success pop up.

Best, 

Dave / MailEdge

Link to post
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...