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

Centos6 下 logrotate 探源

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

前言

有一天发现自动生成的文件归档和cron job中的时间不一致,于是想弄清原因,最后找到了原因,是由系统下面logrotate来负责生成的,下面对logrotate的执行时间进行探源。


概要


Centos5 与Centos6的区别

这是Centos5下面的crontab文件

代码语言:javascript
复制
[test@Test ~]$ cat /etc/crontab 
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
[test@Test ~]$ 

这是Centos6下面的crontab文件

代码语言:javascript
复制
[root@Test-slave ~]# cat /etc/crontab  
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed

[root@Test-slave ~]# 

本文系转载,前往查看

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

本文系转载前往查看

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 概要
    • Centos5 与Centos6的区别
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档