php cron job every 10 minutes [closed]

耗尽温柔 提交于 2019-11-27 02:17:47

问题


I'm trying to run a cron job so that a php script will run every 10 minutes on my server. The script updates a database. Right now my crontab looks like:

* /10 * * * * /usr/bin/php  /home/user/public_html/domain.com/private/update.php

However, the php script never seems to run. I've also tried reloading cron after updating the cron tab with :

  $ /etc/init.d/cron reload

but this didn't work either. Does my current crontab look correctly formatted? Are there specific permissions that need to be specified on a file in order for it to run a script?


回答1:


There should not be a space between "*" and "/10". It should be:

*/10 * * * * /usr/bin/php  /home/user/public_html/domain.com/private/update.php


来源:https://stackoverflow.com/questions/1830208/php-cron-job-every-10-minutes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!