前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Centos6 下 logrotate 探源1

Centos6 下 logrotate 探源1

作者头像
franket
发布2022-07-10 00:01:49
2240
发布2022-07-10 00:01:49
举报
文章被收录于专栏:技术杂记技术杂记

可知对于Centos6每日的计划任务不在crontab里定义

实际定义位置是anacrontab

代码语言:javascript
复制
[root@Test-slave ~]# cat /etc/anacrontab 
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22

#period in days   delay in minutes   job-identifier   command
1	5	cron.daily		nice run-parts /etc/cron.daily
7	25	cron.weekly		nice run-parts /etc/cron.weekly
@monthly 45	cron.monthly		nice run-parts /etc/cron.monthly
[root@Test-slave ~]# 

它的意义是:每一天的3点到22点期间随机延时45分钟+5分钟,执行/etc/cron.daily中的任务,通知给root (此处只对daily work进行解释,其它类推)

然后我们看看/etc/cron.daily下的内容

代码语言:javascript
复制
[root@Test-slave ~]# ll /etc/cron.daily
total 28
-rwx------. 1 root root  118 Oct 15 23:33 cups
-rwxr-xr-x. 1 root root  196 Jul 18  2013 logrotate
-rwxr-xr-x. 1 root root  905 Feb 22  2013 makewhatis.cron
-rwxr-xr-x. 1 root root  174 Sep 24  2012 mlocate.cron
-rwxr-xr-x. 1 root root 2126 Jul 19  2013 prelink
-rwxr-xr-x. 1 root root  563 Nov 23  2013 readahead.cron
-rwxr-xr-x. 1 root root  365 Oct 16  2009 tmpwatch
[root@Test-slave ~]# 

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档