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
相關文章
相關標籤/搜索