Crontab 每次运行运行命令 3 次
我在 RHEL 服务器上设置了以下 crontab ...
[email protected]
*/2 * * * * wget --spider -q http://mydomain.com/cronjobs/importxml.php
如您所见,它应该每 2 分钟运行一次,确实如此,但它运行该命令三次,我不明白为什么。
如果我运行
tail /var/log/cron
,我会得到以下内容
Dec 12 13:56:01 msvsc02-g283nc crond[1431]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3224]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
Dec 12 13:56:01 msvsc02-g283nc crond[2504]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3226]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
Dec 12 13:56:01 msvsc02-g283nc crond[2472]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3228]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
有人能解释一下吗?
I have the following crontab set up on a RHEL server ...
[email protected]
*/2 * * * * wget --spider -q http://mydomain.com/cronjobs/importxml.php
As you can see this should run every 2 minutes, which it does, but it runs the command three times and I can't figure out why.
If I run
tail /var/log/cron
I get the following
Dec 12 13:56:01 msvsc02-g283nc crond[1431]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3224]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
Dec 12 13:56:01 msvsc02-g283nc crond[2504]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3226]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
Dec 12 13:56:01 msvsc02-g283nc crond[2472]: (root) RELOAD (cron/root)
Dec 12 13:56:01 msvsc02-g283nc crond[3228]: (root) CMD (wget --spider -q http://mydomain.com/cronjobs/importxml.php)
Can anyone shed any light on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能在该服务器上运行多个 cron 进程。这通常不会发生。但无论如何,请确认
您可以通过以下方式停止它,
或者
使用“kill PID”(不推荐)。
要开始使用 start - 而不是上述两个命令中的 stop 。
You may have more than one cron process running in that server. This normally wont happen. But anyway confirm it with
You can stop it by,
or
or use 'kill PID' ( not recommended ).
And to start use start - instead of stop in either of above two commands.