46
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

【logrotateの実行タイミング】/etc/crontabに無い時の確認方法

logrotate(daily, weekly,monthly)の実行タイミング

/etc/crontabに無い時は/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

しかも実行タイミングが違います。
dailyを一例に取ると
3:11~3:50の間に実行されます。

ググッタら書いてありました。

引用元

https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automating_System_Tasks.html

何故/etc/crontabに書いていないのか

答え

centos5以前であれば/etc/crontabに
centos6以降デフォルトでは/etc/anacrontabに
という事らしいです。

ありがとうございます!!!

引用元

http://hack.aipo.com/archives/420/

旧logrotateのタイミング

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



Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
46
Help us understand the problem. What are the problem?