logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

learn more… | top users | synonyms

6
votes
4answers
2k views

Rotate logs of a dumb non-interactive application

Ubuntu 10.4 Server. I have a dumb non-interactive legacy service which is running constantly on my server. It is writing its log to a file with fixed name (/var/log/something.log). It does not ...
12
votes
5answers
2k views

Grepping through .gz log files

Does there exist a magical shell piping which would allow easily to grep through bunch of .gz log files without needing to extract them somewhere? .gz files are Apache logs, result of log rotation. ...
7
votes
3answers
4k views

Logrotate Successful, original file goes back to original size

Has anyone had any issues with logrotate before that causes a log file to get rotated and then go back to the same size it originally was? Here's my findings: Logrotate Script: ...
1
vote
2answers
2k views

Logrotate configuration for httpd (CentOS)

I'm running Apache 2.2.3 on CentOS 5.5 and just noticed the following logrotate postrotate configuration in /etc/logrotate.d/httpd: postrotate /sbin/service httpd reload > /dev/null 2>/dev/null ...
16
votes
1answer
12k views

logrotating files in a directories and its subdirectories

Is it possible to get logrotate to consider logfiles in a directory and all its subdirectories? (i.e. without explicitly listing the subdirectories.)
15
votes
4answers
11k views

logrotate daily and size?

If a logrotate config is specified with "size" and "daily" parameters, which one takes precedence? Where is this documented? I would like these rotations to occur as a boolean OR operation, ie, if the ...
12
votes
2answers
10k views

How does logrotate exactly handle “daily”?

Judging by the timestamps on my systems, logrotate does its daily log rotation when logrotate is run by cron. However, if I run it earlier than that it doesn't rotate the files. How does logrotate ...
5
votes
1answer
4k views

Logrotate does not remove old logs

for some reason the old log files are not deleted. Example with apache What the conf file says: $ cat /etc/logrotate.d/apache2 /var/log/apache2/*.log { weekly missingok rotate 2 ...
9
votes
2answers
3k views

MySQL doesn't logs error to new file after rotating?

Problem solved but I'm writing down for the future reference. /root/.my.cnf [mysqladmin] user = root password = pa$$w0rd /etc/logrotate.d/mysql /var/log/mysql-slow.log ...
3
votes
1answer
5k views

How do you rotate apache logs on windows without interrupting service?

I administrate a Windows Server 2003 (Standard Edition, 32-bit) installation running Apache2 and ColdFusion. The server has over 100 virtual hosts, each with an access log and an error log. I've been ...
2
votes
3answers
745 views

Benefits of log rotation

I have been using logrotation for years and never thought too much of it being a problem until I came across a question on stackoverflow ...
2
votes
4answers
3k views

nginx logrotate config

Whats the best way to rotate nginx logfiles? In my opinion, I should create a file "nginx" in /etc/logrotate.d/ and fill it with the following code and do a /etc/init.d/syslog restart after that. ...
9
votes
1answer
2k views

How to rotate log based on an interval unless log exceeds a certain size?

From the man page of logrotate: minsize size Log files are rotated when they grow bigger than size bytes, but not before the additionally specified time interval (daily, weekly, monthly, ...
2
votes
2answers
965 views

Preventing logrotate's dateext from overwriting files

I'm working with a system where I would like to use the dateext function of logrotate (or some other way) to add the date to a logfile when it is rotated. However in this system it is important that ...
1
vote
2answers
164 views

Log rotate log from standard out

I have a program which takes an argument to allow extra debug from a piece of hardware we use. The log is just written to standard out so normally we just pipe the standard out to a file i.e. ...
1
vote
3answers
2k views

Apache access log rotation

I think my system is using logrotate for rotating logs including httpd logs The "current" files is logged here /var/log/httpd/ but I only see the last 5 days(I think) But how can I find where ...