在 Plesk 11 中设置 cron 任务 [英] Setting up cron task in Plesk 11

查看:23
本文介绍了在 Plesk 11 中设置 cron 任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 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 11.5 和 Plesk 12+ 的界面变化 - 无需打开显示高级操作".

最新的 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:

  1. 使用您的脚本作为参数直接调用 php 二进制文件.

可执行文件的路径:C:Program Files (x86)ParallelsParallels PanelAdditionalPleskPHP55php.exe

参数:你的脚本路径,如C:inetpubvhostsdomain.tldhttpdocsscript.php

Arguments: path to you script like C:inetpubvhostsdomain.tldhttpdocsscript.php

注意:注意解释路径,...AdditionalPleskPHP55php.exe 为PHP 5.5的路径,您可以将PleskPHP55改为PleskPHP5、PleskPHP53或PleskPHP54使用另一个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:

可执行文件路径:C:WindowsSystem32WindowsPowerShellv1.0powershell.exe

参数:-c "(new-object system.net.webclient).downloadstring('http://domain.test/script.aspx')"

这篇关于在 Plesk 11 中设置 cron 任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆