每5分钟Crontab [英] Crontab every 5 minutes

查看:623
本文介绍了每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

  1. crontab
  2. 中明确记录所有分钟
  3. 在实际命令之前运行sleep命令
  1. Write explicit all minutes in crontab
  2. Run sleep command before the actual command

这篇关于每5分钟Crontab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆