crontab的第五场 [英] Fifth field of crontab

查看:69
本文介绍了crontab的第五场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是LINUX的新手.我对cron的工作方式有一个清晰的认识,但是突然间,我心中产生了一个小疑问.假设我想在3月5日凌晨5.30执行 ls 命令,那么我的 cron 命令将是 30 05 05 03 ?? ls.

I am new to LINUX. I have a clear idea on how cron works, but suddenly a small doubt struck at my mind. Suppose if I want to execute ls command on 5th march 5.30AM, then my cron command will be 30 05 05 03 ?? ls.

我的简单问题是,什么条目将出现在 ?? 位置.并假设如果我在该位置输入 01 而不是 ?? ,将会发生什么情况.如果这是一个简单的问题,请原谅,请帮助我解决同样的问题.

My simple question is that what entry will come on ?? place. And suppose if I enter 01 in that position instead of ?? , what will happen. Please excuse me if this is a simple question and please help me solve the same.

推荐答案

在您的情况下

30    05    05  03   *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

?? 说,您不在乎星期几,因为您已经在说出确切的日期.如果放置 01 ,它仍然可以运行,但有多余.

?? says that you don't mind the day of the week because you are already stating the exact date. If you place the 01 it would still run but its redundant.

这篇关于crontab的第五场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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