[英]How to run cron job for php file in godaddy Cpanel?
我正嘗試在我的高迪面板中申請cron職位。 這是我的代碼:
*/5 * * * * /bin/touch /home/checkforplag/public_html/cron_test.txt >/dev/null 2>&1 && /bin/echo "Cron ran at: `date`" >> /home/checkforplag/public_html/cron_test.txt
它工作正常,每隔五分鍾在文本文件cron_test.txt中插入一行。 如:
Cron運行時間:2016年12月16日星期五00:20:01
Cron運行時間:2016年12月16日星期五00:25:01
Cron運行時間:2016年12月16日星期五00:30:01
現在,當我們在我的php文件上應用相同的代碼時:
*/5 * * * * /bin/touch /home/checkforplag/public_html/run.php >/dev/null 2>&1 && /bin/echo run.php >> /home/checkforplag/public_html/run.php
那就不行了 如果工作正常,則應每隔五分鍾在數據庫中插入一條記錄。
如果我錯了,請幫助我找出錯誤。 謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.