Jump to content

Question

Posted

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?

6 answers to this question

Recommended Posts

  • 0
Posted
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

  • 0
Posted

After checking, 

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

is indeed correct, however i get this error

 

PHP Parse error:  syntax error, unexpected '[' in /var/www/vhosts/****.com/httpdocs/clients/config/services.php on line 3

  • 0
Posted

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

 

  • 0
Posted

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 :(

  • 0
Posted

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 :(

  • 0
Posted

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...