排程固定5分鐘執行PHP檔



贊助商連結


pomost
2010-11-07, 02:55 PM
請問如何排程固定5分鐘執行網頁PHP檔?

贊助商連結


tvirus
2010-11-07, 11:41 PM
會用crontab喵?
whereis php看一下執行檔路徑
然後...

/usr/bin/php /root/test.php
或者是...
用curl或wget或lynx一類的工具去做瀏覽器的動作
/usr/bin/curl -s http://tw.yahoo.com >/dev/null

pcboy
2010-11-13, 11:45 PM
*/5 * * * * 執行程式的帳號 被執行程式的完整路徑 [被執行程式的參數]

例如
*/5 * * * * root /bin/mrtg /etc/mrtg/mrtg.cfg

*/5 * * * * root /var/www/html/test.php