ubuntu 14 下使用 crontab 执行php脚本

先编辑一个php文件
<?php
  echo date('Y-m-d H:i:s');
  echo "\r\n";
?>
放在/usr/www/crontab.php
chmod +x /usr/www/crontab.php 可执行文件
crontab -e 输入计划任务执行脚本

* * * * * /usr/local/php/bin/php -f /mnt/hgfs/sharefile/wwwroot/test/crontab/index.php >> /mnt/hgfs/sharefile/crontab/php.log
保存 到 /tmp/crontab
开始执行  crontab /tmp/crontab
中止执行  crontab -r
相关文章
相关标签/搜索