0

我只需要在我的 cPanel 中使用 cron 作业运行以下 url。

当我尝试执行链接时

http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron

该链接正在浏览器中运行,但是当我尝试添加与 cron 作业中相同的 URL 时,我收到以下错误

bash/sh/ file not found

当我将 cron 作业编辑为

/usr/bin/php /home/staging/public_html/index.php?option=com_acymailing&ctrl=cron

但我收到 404 错误。

我的 cPanel 用户名是staging

谁能告诉我 cPanel 中 cron 作业的语法是什么。

每分钟运行一次 Cron 作业,并通过电子邮件报告显示此错误。

4

2 回答 2

0

使用带有完整 URL 的 wget 函数。

于 2013-03-14T15:05:01.467 回答
0

@yannick-blondeau As suggested you can use a wget or curl to make a simple request to your website.

Usually wget will attempt to download a file but this is not necessary with the -O flag to pipe to /dev/null or -q (both options used to prevent from saving output to a file), an example will look like

wget -O /dev/null http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron
wget -q http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron

You can also use curl for the same effect

curl --silent http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron
于 2018-05-05T21:09:46.473 回答