每天在特定时间运行CRON作业 [英] Run CRON job everyday at specific time

查看:720
本文介绍了每天在特定时间运行CRON作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我每天下午3点开始执行cron工作

  0 15 * * * 

但是我想一天执行两次cron工作。 10.30AM和2.30PM

  0 30 10 * * * 

我相信此命令将在上午10.30运行。我应该如何在2.30PM上运行它?

解决方案

Cron 实用程序是安排计划任务的有效方法

Linux Crontab格式


MIN HOUR DOM MON DOW CMD




示例 :: 安排特定时间的工作



cron的基本用法是在特定时间执行作业,如下所示。


请注意,时间字段使用24小时制。因此,对于上午8点使用
8,对于晚上8点使用20。




  30 08 10 06 * / home /您的姓名/完整备份




  • 30 – 30分钟

  • 08 – 08 AM

  • 10 –第十天

  • 06 – 6月(六月)

  • * –每周的每一天



对于您来说, 2.30PM

  30 14 * * * YOURCMD 




  1. 30 – 30分钟

  2. 14 – 2PM

  3. * –每天

  4. * –每月

  5. * –每周的每一天

要了解有关cron的更多信息,请访问此网站


Right now i am running my cron job everyday at 3.00PM

0    15    *    *    *

But I want to run my cron job twice in a day. 10.30AM and 2.30PM

0    30 10    *    *    *

I believe this command will run at 10.30AM. How should i run it in 2.30PM?

解决方案

Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis.

Linux Crontab Format

MIN HOUR DOM MON DOW CMD

Example::Scheduling a Job For a Specific Time

The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.

Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.

30 08 10 06 * /home/yourname/full-backup

  • 30 – 30th Minute
  • 08 – 08 AM
  • 10 – 10th Day
  • 06 – 6th Month (June)
  • *– Every day of the week

In your case, for 2.30PM,

30 14 * * * YOURCMD

  1. 30 – 30th Minute
  2. 14 – 2PM
  3. *– Every day
  4. *– Every month
  5. *– Every day of the week

To know more about cron, visit this website.

这篇关于每天在特定时间运行CRON作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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