仅从早上到晚上设置cron [英] setup cron from morning to evening only

查看:116
本文介绍了仅从早上到晚上设置cron的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须每天运行cron.

I have to run daily cron.

Cron必须运行的时间是上午11点到晚上7点.

Cron must running time will be morning 11 AM to evening 7 PM.

在这段时间内,cron必须每天每15分钟运行一次.

In this given time cron must run at every 15 mins daily.

晚上cron之后是否必须每小时都运行相同的东西?

same thing after in night cron must run at every hour?

使用Linux cron调度类型可以做到这一点.

Is this possible with linux cron scheduling type.

或者我必须通过任何脚本语言来管理它.

Or i have to manage this from any scripting language.

推荐答案

*/15 11-18 * * * statement/to/run
0 0-10,19-23 * * * statement/to/run

应该做你所需要的.

*/15或0,15,30,45都会做同样的事情,并且每15分钟运行一次.

*/15 or 0,15,30,45 will both do the same thing and run every 15 minutes.

您需要将其分为两个条目,因为您希望它在一天的不同时间以不同的方式运行.

You'll need to break it into two entries since you want it to run differently during different times of day.

这篇关于仅从早上到晚上设置cron的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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