免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 14070 | 回复: 9
打印 上一主题 下一主题

[系统管理] /etc/cron.daily定时任务执行的时间是几点? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-12-06 00:57 |只看该作者 |倒序浏览
想问下/etc/cron.daily下面定义的脚本是每天执行一次,但是我想知道一般是几点执行?这个时间是在哪里定义的,在哪里可以修改?

论坛徽章:
0
2 [报告]
发表于 2015-12-06 01:20 |只看该作者
/etc/anacron

论坛徽章:
0
3 [报告]
发表于 2015-12-06 23:45 |只看该作者
回复 2# 扯淡的青春要扯淡对待


   
但是我并没有看出这是定义的几点执行?如果我要改成晚上12:00执行的话要怎么改?

论坛徽章:
5
金牛座
日期:2015-07-03 13:32:00卯兔
日期:2015-07-03 13:32:17程序设计版块每日发帖之星
日期:2015-11-29 06:20:0015-16赛季CBA联赛之同曦
日期:2015-12-15 09:36:06CU十四周年纪念徽章
日期:2016-07-06 17:18:48
4 [报告]
发表于 2015-12-07 09:08 |只看该作者
回复 3# 深海不寂莫


查看/etc/crontab
  1. # run-parts
  2. 01 * * * * root run-parts /etc/cron.hourly
  3. 02 4 * * * root run-parts /etc/cron.daily
  4. 22 4 * * 0 root run-parts /etc/cron.weekly
  5. 42 4 1 * * root run-parts /etc/cron.monthly
复制代码
这个执行时间怎么看自己查下crontab吧

论坛徽章:
0
5 [报告]
发表于 2015-12-07 14:40 |只看该作者
http://bbs.chinaunix.net/thread-4146297-1-1.html
anacron--开机后立刻进行 anacron 的动作,他会去侦测停机期间应该进行但是并没有进行的 crontab 任务


   

论坛徽章:
0
6 [报告]
发表于 2015-12-11 00:06 |只看该作者
回复 4# seanking1987

有没有搞错,我要看/etc/anacrontab的时间设置格式,你搞个/etc/crontab??
   

论坛徽章:
0
7 [报告]
发表于 2015-12-11 00:09 |只看该作者
回复 5# 扯淡的青春要扯淡对待


    问题是我根本没停机,我只是想知道 cron.daily的东西什么时候会被执行?

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-04-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-26 06:20:00
8 [报告]
发表于 2016-12-15 11:40 |只看该作者
回复 7# 深海不寂莫

我也想知道,看到别人的crontab 中有这些目录的执行时间,我的默认没有啊?
可是确定这些定期任务也是执行了的。。所以应该有默认执行时间,我再找找看

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-04-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-26 06:20:00
9 [报告]
发表于 2016-12-15 17:12 |只看该作者
stackExchange上的答案,如果安装了anacron 这个包,那么在/etc/cron.d/ 目录下会有相应的文件(我只有一个0hourly 文件,并没有0daily 之类的*_*)
其中规定了定时任务的执行时间:

Approximately 7:35am, but the exact timing will depend on anacron.

By default cron delegates the running of /etc/cron.daily jobs to anacron. /etc/crontab contains the line:

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
but this defines the behaviour if anacron is not installed

With anacron installed, the running of cron.daily jobs is controlled by the entry in /etc/anacrontab:

1   5   cron.daily   nice run-parts --report /etc/cron.daily
which says run these jobs once per day, with a delay of 5 minutes.

anacron itself is run by cron, as specified in the file /etc/cron.d/anacron, which runs anacron at 7:30am.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP