每 10 分钟执行一次 php cron 作业

2022-01-03 00:00:00 cron crontab php

我正在尝试运行 cron 作业,以便在我的服务器上每 10 分钟运行一次 php 脚本.该脚本更新数据库.现在我的 crontab 看起来像:

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

然而,php 脚本似乎永远不会运行.我还尝试在使用以下命令更新 cron 选项卡后重新加载 cron:

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

但这也不起作用.我当前的 crontab 看起来格式正确吗?是否需要为文件指定特定权限才能运行脚本?

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?

推荐答案

*"和/10"之间不应有空格.应该是:

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

相关文章