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

2
votes
1answer
604 views

logrotate compress only last n logs

I need to make a daily rotate of /var/log/messages to be kept for 60 days, where the last 30 logs must be compressed with bzip2. This is my logrotate config: /var/log/messages { ...
3
votes
1answer
2k views

FreeBSD 8.1 64bit logrotate - ELF interpreter /libexec/ld-elf-so.1 not found

I am trying to get logrotate running on a FreeBSD 8.1 virtual machine. I installed the logrotate with pkg_add, I have created the logrotate.config file and also run: mkdir /var/lib/ touch ...
5
votes
2answers
3k views

Can postgres internal log rotation mechanism delete log files older than a certain time?

I am using posgtres' internal log rotation mechanism. I would like log files older than 30 days to be deleted. How do I get postgres to do this? If postgres does not support it, can I set logrotate to ...
0
votes
1answer
191 views

can logrotate process all *.log in a directory tree?

Logrotate can work on individual files or wildcarded files (*.log, for example) in a specified directory, but does it inherently have the ability to traverse a directory tree of arbitrary depth and ...
0
votes
2answers
88 views

apache access.log to keep only records from last 3 monthes

I need Apache accesslog file to be parsed fast in realtime and always to keep only last 3 months data. So I need tool which everyday cutting old records(and moving them to another file) from log file ...
1
vote
1answer
187 views

How do I work around the fact that Apache needs to be restarted to rotate the logs?

It seems so "primitive" that HTTPD has to be restarted just to rotate the logs. There has got be other ways to accomplish this! Note that I do not use nor wish to use AWStats, one of the ways to ...
1
vote
1answer
2k views

What process creates the access_log.processed file

We are having some problems with log rotation on our Centos box. We've configured the server to perform a logrotation every day and keep the logs for 30 days. In our log folder, every day a file ...
0
votes
1answer
305 views

How to make logrotate keep the last week into the current .log

Is it possible to get logrotate to keep the last week of logs in the current file? for example : errors.log contains 30 days of logs after log rotate executes , I would have : errors.log with ...
1
vote
1answer
6k views

logrotate won't rotate my logs automatically

I have two different (i386 v AMD) Debian boxes and have the same problem. logrotate won't rotate my logs automatically. It works fine when i force it manually like /usr/sbin/logrotate -f ...
1
vote
1answer
707 views

Varnish logrotate issue

I have this in logrotate.d/varnish file: /var/log/varnish/*log { create 640 http log compress postrotate /bin/kill -USR1 `cat ...
0
votes
1answer
202 views

Understanding logrotate's create directive

There is a web application (php/apache2) which opens a log file somewhere at a start of a request handling and closes it (as far as I know) when the handling is finished. Between log file open and ...
9
votes
2answers
13k views

When to use delaycompress option in logrotate?

The man page of logrotate says that: It can be used when some program cannot be told to close its logfile and thus might continue writing to the previous log file for some time. I'm confused by ...
6
votes
3answers
2k views

Preferred format of file names which include a timestamp

As we all know "unix" can have anything in a file except '/' and '\0', sysadmins however tend to have a much smaller preference, mainly due to nothing liking spaces as input ... and a bunch of things ...
1
vote
1answer
162 views

How do I tell logrotate what files to rotate with cron?

On my webserver I have this file: /etc/logrotate.d/apache2 I know it is logrotating /var/log/apache2/.log, but if I want to add things that are in /usr/home/www/site1/logs/.log do I just duplicate ...
2
votes
1answer
407 views

Reason to use rsyslog for log rotating?

Is there any benefit to using rsyslog's rotation abilities over the standard /sbin/logrotate?
0
votes
2answers
297 views

logrotation size limit is not effecting

I have fixed size limit in logrotation 1M. The script run on every hours even though its rotating less than 1Mb files. I dont know what i have done wrong. Below is my configuration parameters. ...
2
votes
1answer
2k views

Understanding reference to /var/log/wtmp in /etc/logrotate.conf

I have the following lines in my /etc/logrotate.conf file which I'm not quite sure what they do: (Edited in to show full file) # see "man logrotate" for details # rotate log files weekly weekly # ...
13
votes
5answers
3k 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. ...
2
votes
2answers
1k 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
1answer
633 views

Determine root cause of broken pipe on Linux?

I have a webapp running on some servers that have their Apache log files on an OCFS2 SAN volume. The internal webapp logging is done using log4perl, in pipe mode, with cronolog on the other end of ...
0
votes
1answer
1k views

Logrotate and copytruncate on file larger than remaining free space

I have a Nagios alert about disk space on our /var/log mountpoint on a production system. We have a catalina.out (Tomcat) file which has grown to 768 megs, and there are 171 megs left on the mount ...
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 ...
3
votes
3answers
10k views

How to compress and clean logs with logrotate but not rotate them

I have a Tomcat server which create access logs via a valve (org.apache.catalina.valves.FastCommonAccessLogValve). This valve takes care of rotating the access log file, but not of compressing them ...
1
vote
2answers
572 views

Any good reason not to use date-based logfile rotation (rdiff-backup)?

rdiff-backup is a really nice tool for backing up Linux servers. One problem, though, is logrotation: Since rdiff-backup doesn't know how to detect renamed files, every daily backup contain a ...
0
votes
2answers
2k views

Apache log rotation: logrotate vs rotatelogs vs chronolog

I have been researching log rotation for my server which hosts ~5 fairly high traffic sites. From what I can tell, my options are to use logrotate or to use piped logging with either rotatelogs or ...
1
vote
3answers
525 views

logrotate deleting files

On one of my servers I have following in /etc/logrotate.d/apache2 /var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty ...
3
votes
2answers
1k views

apache restarted/reloaded config by itself automatically, why?

in short: running production webserver tuesday: changed config (the change was erroneous, wrong syntax) but deliberately not restarted apache apache restarted or reloaded config by itself today ...
0
votes
2answers
665 views

logrotate not working. Is this configuration correct?

/var/log/apache2/*.log { daily missingok rotate 31 compress delaycompress notifempty create 640 root adm sharedscripts ...
0
votes
1answer
156 views

directory which stores logs has grown to 3.7 GB how can I manage

I am having this situation the log file /var/log/auth.log on my server has grown very large in size.A lot of webserver are running on it and similar stuff I see the log entries since 15 days have not ...
1
vote
2answers
2k views

How to logrotate daily backups?

At my company we create daily backups (full, not incremental) of our various stuff. We'd like to rotate them in the following way: keep daily backups for the past week keep only weekly backups for ...
0
votes
2answers
229 views

logrotate pattern matching for daemon restart

In a setup very much like: http://wiki.apache.org/httpd/ExtendingPrivilegeSeparation I have logs located in /var/weblog/<domain>/error_log I would like to use logrotate to rotate these logs ...
6
votes
2answers
4k views

rotate nohup out file (nohup.log)

is there a 'native' way where i can rotate nohup out file ?
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: ...
2
votes
3answers
776 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
1answer
153 views

Log file - 1.6 GB - how to push rotation of log file

How do I push the rotation of a log file.... other_vhosts_access.log is 1.6 GB right now.... the odd thing is that the date on the file is for today, the last rotated file is from 12-12 (a week ago) ...
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. ...
22
votes
2answers
15k 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.)
1
vote
1answer
85 views

Alter an existing logrotate file on package install

I have created a debian package that sets up awstats and the required scripts for a couple of hostnames in a server I have. My problem is with logrotate, I already update the stats with a cron job I ...
1
vote
1answer
669 views

Apache Logrotate Bash Question

... so I'm trying to rotate logs on amazon cloud auto-scaled server instances every hour. I've created /etc/cron.hourly/logrotate to read: #!/bin/bash test -x /usr/sbin/logrotate || exit 0 ...
14
votes
2answers
11k 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 ...
0
votes
2answers
976 views

can I use logrotate to rotate /core files?

On remote linux-based devices, I thought I'd use logrotate to manage any core files our appliance may create. But it seems logrotate considers every core file a unique file since the filename ...
9
votes
2answers
3k views

Logrotate: how to access the output file in postrotate

I rotate Nginx logs daily (with dateext). After the rotation I want to parse the file for the day that just passed and compile an email with the number of errors returned by Nginx server. How can I ...
8
votes
3answers
4k views

Logrotate: Rotating non-log files?

I have a backup script that compresses various files and directories and creates .tgz archives. Files are named, e.g. ... backup_2010-10-28.tar.gz backup_2010-10-29.tar.gz backup_2010-10-30.tar.gz ...
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 ...
17
votes
5answers
15k views

How can I monitor what logrotate is doing?

How can I monitor what logrotate is doing in Ubuntu? Can the activity of logrotate be monitored?
1
vote
1answer
5k views

Specific names after logrotate

I'd like logrotate to create files which have nice names. Is there some way to force some pattern for the names after rotation? I'd like to create a service-{year}-{month}-{day}-{hour} format and ...
0
votes
2answers
273 views

logrotate problems

I have the following problem. When my logs are rotated something like that is procuded -rw-r--r-- 1 root admin 169K Sep 24 12:15 messages -rw-r--r-- 1 root admin 0 Sep 24 04:03 messages.1 ...
1
vote
3answers
5k views

Logrotate Mysql - No rotate happens

I work with CentOS5, and I have the following version of mysql : mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1 I want to rotate the logs of mysql using ...
3
votes
3answers
913 views

Is there any alternate to logrotate for apache logs?

I need an alternate for rotating logs on my server, everytime logrotate runs apache goes down for like 10-20 minutes, i'm not sure if this is right, but don't seem right for me. Is there any ...
0
votes
2answers
288 views

Why is apache2 not logging properly given the following logrotate.conf

access_log seems to be permanently size 0. But error_log is written to fine. Surprisingly access_log.[1-5].gz are created but only access_log.3.gz and access_log.4.gz contain non-empty logs. Ok, so ...