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

1
vote
1answer
679 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
193 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
12k 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 ...
4
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
157 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
401 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
268 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 # ...
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. ...
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
629 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
9k 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
567 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
518 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
220 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
3k 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
757 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
148 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. ...
21
votes
2answers
13k 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
653 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
942 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
3k 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 ...
14
votes
4answers
14k 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
4k 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
267 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 ...
2
votes
3answers
894 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
278 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 ...
8
votes
2answers
3k views

Apache2 and logrotate: delaycompress needed?

I am currently looking at the file size of my Apache logs as they became huge. In my logrotate conf, I have delaycompress enabled. Does Apache really need this (as the logrotate documentation says ...
8
votes
3answers
13k views

When & how does logrotate run under Ubuntu 10.04?

I am new to sysadmining and have a few questions: Where and how is the logrotate procedure initaited by the system? What time of day are my "daily" rotated logfiles being rotated? Do the prerotate ...
1
vote
0answers
286 views

How to configure logrotate to just prune a directory once a week?

How to configure logrotate to just delete all files under selected directory once a week? I'm testing the following: /var/spool/mydir/* { daily rotate 0 nocompress copytruncate } ...
4
votes
1answer
1k views

I want my logs sent to my mail with logrotate

Not strictly a question about programming as such, more of a log handling question. Anyway. My company has multiple clients, and each of these clients have a set of logs that I'd rather much want to ...
0
votes
3answers
1k views

Logfiles go blank after logrotate rotates them

I have an ubuntu 8.04 LTS server that runs openvpn. The openvpn server writes to a standard logfile under /var/log and prior to a month ago logrotate would automatically rotate the files and compress ...
0
votes
1answer
177 views

Strange behavior of logRotate?

I have the following configuration of logrotate: /var/log/test/app.log { missingok notifempty compress copytruncate daily rotate 4 } The application ...
0
votes
1answer
1k views

logrotation within Jboss 4

I have looked around and I havent been able to find a clear cut answer to how this can be configured. i read that the native logrotate is a bad idea. so is there a way to do this within the log4j ...
0
votes
2answers
1k views

Nginx, logrotate and empty files

I have a problem with nginx/logrotate. The problems is that nginx is logging access to 2 files (main and data). I have the following contrab setting: 0 * * * * /usr/sbin/logrotate -f ...
1
vote
1answer
666 views

Apache, logerror and logrotate: what is the best method?

Here's a vhost example of my sites: <VirtualHost *:80> DocumentRoot /datas/web/woog ServerName woog.com ServerAlias www.woog.com ErrorLog "|/httpd-2.2.8/bin/rotatelogs ...