【发布时间】:2012-08-31 23:37:14
【问题描述】:
我通过编辑 /etc/crontab 来创建一个简单的 cron 作业,如下所示:
*/2 * * * * * php /Users/min/Documents/testcron.php
testcron.php 很简单:
<?php
$fd = fopen("/Users/min/Documents/testcron.txt", 'a');
fwrite($fd, "test--cron--\n");
fclose($fd);
?>
然后简单地保存 crontab 文件并希望奇迹发生,但什么也没发生。我什至手动运行命令并且它工作。
php /Users/min/Documents/testcron.php
有人知道吗?谢谢
【问题讨论】: