为什么这个cron条目执行两次? [英] Why is this cron entry executed twice?
问题描述
* / 5 * * * * my command
*/5 * * * * my command
这个条目可以工作,但每5分钟执行两次,为什么?
This entry works but every 5 minutes it get executed twice, why?
在/ var / log / cron中显示:
Jun 16 22:20:01测试CROND [12512]:(root)CMD(我的命令) :20:01测试CROND [12516]:(root)CMD(我的命令)
所以这不是来自两个uer。
它只能用crontab -e -u root进入一次
< br>命令是一个php命令。
In /var/log/cron it shows:
Jun 16 22:20:01 Test CROND[12512]: (root) CMD (my command)
Jun 16 22:20:01 Test CROND[12516]: (root) CMD (my command)
So it's not from two uers.
It is only entered once with crontab -e -u root
The command is a php command.
推荐答案
描述中没有任何内容给出执行两次的原因。
Nothing in the description gives reason for it to be executed twice. Look elsewhere.
- 两个用户是否打电话?
- 输入两次?
- 是否自称?
- 是否在运动条件中设置重复?
- Do two users call it?
- Is it entered twice?
- Does it call itself?
- Does it set in motion conditions for repetition?
如果是正在执行的shell脚本,请将 whoami
和 date
附加到日志文件。
If it's a shell script you're executing, have it append whoami
and date
to a log file. You should be able to dig up the reason.
键入ps -A,确保crond isn不运行两次。
Type ps -A, make sure crond isn't running twice.
这篇关于为什么这个cron条目执行两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!