每5分钟Crontab [英] Crontab every 5 minutes
本文介绍了每5分钟Crontab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何告诉crontab每5分钟运行一次,但是要从每小时的第二分钟开始.换句话说,我想在minute % 5 = 2
时执行我的脚本.
How could i tell crontab to run every 5 minutes, but starting at the second minute of the hour. In other words, i would like to execute my script when minute % 5 = 2
.
例如,我的脚本应在以下位置运行:
For example, my script should run at :
08:02
08:07
08:12
08:17
...
感谢您的帮助!
推荐答案
有两种可能性:
2,7,12,17... command
*/5 .... sleep 120 ; command
- 在
crontab
中明确记录所有分钟
- 在实际命令之前运行
sleep
命令
- Write explicit all minutes in
crontab
- Run
sleep
command before the actual command
这篇关于每5分钟Crontab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文