如何设置cron每隔一个半小时运行某些命令? [英] How can I set cron to run certain commands every one and a half hours?

查看:254
本文介绍了如何设置cron每隔一个半小时运行某些命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置cron每一个半小时运行某些命令?

How can I set cron to run certain commands every one and a half hours?

推荐答案

表达式在正常 cron

无需修改代码就可以做到最好:

The best you could do without modifying the code is:


0 0,3,6,9,12,15,18,21 * * * [cmd]

30 1,4,7,10,13,16,19,22 * * * [cmd]

这些可能是可压缩的,具体取决于cron的版本:

These might be compressible, depending on the version of cron you have to:


0 * / 3 * * * [cmd]

30 1-23 / 3 * * * [cmd]

这篇关于如何设置cron每隔一个半小时运行某些命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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