I’m trying to setup a cron task in Plesk to run a short script every 5 minutes, I’ve just moved from a managed hosting account to a full access Plesk VPS, and I’m a little lost on a couple of things, this one in particular, when I go to Server > Scheduled Tasks
I get a list of ‘system users’ as below, but I’m not sure under which user to make the cron task, any ideas?
- adm
- apache
- bin
- daemon
- ftp
- games
- gopher
- .. going all the way down to webalizer
The cron script path is below if that’s relevant as to which user to choose –
/var/www/vhosts/mysite.com/httpdocs/scripts/index.php
3
Answers
If you are going to create subscription-level task, than you can create cron/windows scheduler task in:
“Subscriptions” > your subscription > “Websites & domains” > click on “Show advanced operations” > “Scheduled Tasks” > there will be only one name of FTP user of your subscription.
Note: Pay attention to interface changes for Plesk 11.5 and Plesk 12+ – there is no need to open “Show advanced operations”.
The latest Plesk 12.5 provide a lot of options to cover most of the task cases:
Plesk 12.5
![Plesk schedule run PHP script](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E)
Other Plesk versions support only “Run a command” option:
Plesk 12.0
Plesk 11.5
If you need just answer, in “Server” -> “Scheduled Tasks” you can choose:
FTP user of your subscription
mysite.com
your can choose
root
, but it’s not recommended for security reasons.For Plesk version below 12.5 to schedule execution of PHP script on Windows there is two ways:
Direct call of
php
binary with your script as argument.Path to executable file:
C:Program Files (x86)ParallelsParallels PanelAdditionalPleskPHP55php.exe
Arguments: path to you script like
C:inetpubvhostsdomain.tldhttpdocsscript.php
Note: Pay attention to interpretation path,
...AdditionalPleskPHP55php.exe
it path for PHP 5.5, you can change PleskPHP55 to PleskPHP5, PleskPHP53 or PleskPHP54 to use another PHP version.Call script via request to your site:
Path to executable file:
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
Arguments:
-c "(new-object system.net.webclient).downloadstring('http://domain.test/script.aspx')"
https://www.motherhost.com/help/creating-or-removing-scheduled-tasks-in-plesk/
Creating a Scheduled Task in Plesk 10:
You can set up Scheduled Tasks in Plesk by doing the following:
Removing a Scheduled Task in Plesk 10
Use this command: