【发布时间】:2013-11-16 12:35:16
【问题描述】:
我正在尝试在 php 中执行 at 命令,但它不起作用..假设我想在 10 分钟后执行一个 php 脚本,所以我为它编写的代码..
ob_start();
system('echo curl http://www.domain.com/timetest.php | at now + 10 min 2>&1', $returnVal);
$output = ob_get_clean();
但是这个命令在控制台上运行良好,比如..
echo curl http://www.domain.com/timetest.php | at now + 10 min
如果我执行以下命令,它可以在控制台和 php 中工作,但它会立即执行脚本...
system('curl http://www.domain.com/timetest.php | at now + 10 min 2>&1', $returnVal);
我还通过谷歌搜索尝试了更多格式..like..
system('echo "curl http://www.domain.com/timetest.php" | at now + 10 min 2>&1', $returnVal);
请有人帮我把它弄好。 提前致谢。
【问题讨论】:
标签: php command job-scheduling