问题描述
我正在尝试在 Plesk 中设置一个 cron 任务,每 5 分钟运行一个简短的脚本,我刚刚从托管主机帐户转移到完全访问 Plesk VPS,我对几个有点迷茫事情,特别是这一点,当我去 Server >计划任务
我得到一个系统用户"列表,如下所示,但我不确定在哪个用户下执行 cron 任务,有什么想法吗?
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?
- 管理员
- 阿帕奇
- 斌
- 守护进程
- ftp
- 游戏
- 地鼠
- ...一直到 webalizer
如果与选择哪个用户相关,则 cron 脚本路径在下方 -
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
推荐答案
如果您要创建订阅级任务,那么您可以在以下位置创建 cron/windows 调度程序任务:
If you are going to create subscription-level task, than you can create cron/windows scheduler task in:
订阅"> 您的订阅>网站和域"> 单击显示高级操作">计划任务" > 您订阅的 FTP 用户将只有一个名称.
"Subscriptions" > your subscription > "Websites & domains" > click on "Show advanced operations" > "Scheduled Tasks" > there will be only one name of FTP user of your subscription.
最新的 Plesk 12.5 提供了很多选项来涵盖大多数任务案例:
The latest Plesk 12.5 provide a lot of options to cover most of the task cases:
Plesk 12.5
其他 Plesk 版本仅支持运行命令"选项:
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 用户
mysite.com
您可以选择root
,但出于安全原因不建议这样做.
your can choose root
, but it's not recommended for security reasons.
对于低于 12.5 的 Plesk 版本,在 Windows 上安排 PHP 脚本的执行有两种方式:
For Plesk version below 12.5 to schedule execution of PHP script on Windows there is two ways:
使用您的脚本作为参数直接调用
php
二进制文件.
可执行文件的路径:C:Program Files (x86)ParallelsParallels PanelAdditionalPleskPHP55php.exe
参数:你的脚本路径,如C:inetpubvhostsdomain.tldhttpdocsscript.php
Arguments: path to you script like C:inetpubvhostsdomain.tldhttpdocsscript.php
通过对您网站的请求调用脚本:
Call script via request to your site:
可执行文件路径:C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
参数:-c "(new-object system.net.webclient).downloadstring('http://domain.test/script.aspx')"
这篇关于在 Plesk 11 中设置 cron 任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!