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

3
votes
3answers
107 views

logrotate security

Are there any concerns about the security of logrotate running as root? Had someone ask couldn't a malicious user subvert the config to overwrite anything? Is is okay to run logrotate out of the ...
6
votes
1answer
6k 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
3answers
11k views

logrotate not rotating the logs

I have this logrotate config and I am running on Ubuntu 10.04. /var/log/mysql/mysql-slow.log { daily rotate 3 compress notifempty missingok create 660 mysql adm postrotate ...
8
votes
3answers
605 views

Free-space driven log rotation on linux?

Someone just asked me 'how long should we keep logs for our application', and my answer was 'until the disk is full' as there's no reason to throw them away other than running out of space. However, ...
0
votes
1answer
331 views

Memcached logrotate file not being installed. Bug with memcached 1.4.2?

My memcached logs are getting huge (in excess of 5GB). This isn't a huge problem in itself. I can easily remove them. I've sourced the problem to the memcached 1.4.2 package not installing a ...
3
votes
1answer
222 views

Can I manually compress file when logrotate with delaycompress is active

I have a daily logrotate set up with compress, missingok, delaycompress, dateext options. I need to compress the delayed log file. Can I do it manually now or should I wait till logrotate does it when ...
0
votes
1answer
762 views

using logrotate on win7 with cygwin

I am using the famous logrotate with windows 7 and cygwin, I have the latest cygwin dll but somehow the app doesn't work for me, and the config file seems to be ok. Has anyone encountered this before? ...
0
votes
1answer
242 views

setting logrotate to use UTC time

Is it possible to force logrotate to use UTC time for one configuration? I need the dateext to be set to UTC. I was hoping it was as simple as setting a date varible. Should I just run postrotate and ...
0
votes
2answers
412 views

Apache Log Rotation

Is there any mod or program for Apache Httpd which rotate logs as well as purge them without the restarting of server processes? I have checked a few options, mod_autorotate, rotatelogs, ...
0
votes
2answers
288 views

Logrotate won't rotate logs with a space

I have a log file a service of mine makes that has the filename "Feed1 - 1.stat". logrotate refuses to rotate this file, but only when run via cron. Running logrotate via the shell will rotate the ...
12
votes
3answers
9k views

Equivalent of LogRotate for Windows?

We have a huge logfile being written by a vendor's application. Let's assume the vendor won't do anything that we ask. Is there any way of rotating that logfile somehow? We're looking at about 300 MB ...
1
vote
3answers
2k views

Apache becomes unresponsive on Sundays

For some reason, most Sundays around 5-6AM local time Apache is not working properly. I can't find the reason, and I'm stuck troubleshooting. I'm running Magento on Apache2 with an SSL certificate, ...
20
votes
4answers
5k views

Equivalent of logrotate on OSX

Is logrotate hiding somewhere on OSX, or is there an equivalent? It's not in /usr/sbin.
5
votes
5answers
250 views

How should I deal with logs before they get to big?

I found out my disk was full today, and I freed up 10% just from deleting mostly logs from multiple websites. I, personally, like to keep logs as an archive, because I may need to look back on them ...
2
votes
2answers
235 views

Best Way to Keep Up on Linux Log Files

I run multiple Linux (Ubuntu) web servers and am looking for a convenient way to keep tabs on important log files. I'd like to monitor pertinent LAMP logs as well as server accesses/logins. Are there ...
0
votes
2answers
866 views

logrotate fails to instruct Apache to reopen logs on Amazon Linux

I have very good experience with logrotate normally, but on a recent installation using "Amazon Linux" (CentOS 6 deployed by Amazon) on EC2, logrotate fails to cause Apache to reopen its logs. The ...
1
vote
2answers
135 views

unidentifiable httpd log rotator

I have my own server instance which is centos 5.7 and have installed apache some time ago. Now I noticed that my log files are rotating. I couldn't remember if I had set up something or not since ...
1
vote
1answer
515 views

Mail logs files as attachments with sendmail

I'm using logrotate to rotate my log files. I've set it up to create new logfiles every week. However I would like it to first mail me the logfiles as attachments. The /var/log/httpd file currently ...
1
vote
1answer
486 views

nginx host server log rotation all sites

I have setup individual log files for each of my sites in the directory /var/log/nginx-hosts/ and I have to configure log rotation for those files. The base I am starting with is ...
2
votes
1answer
660 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
3k 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 ...
1
vote
1answer
211 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
93 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
189 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
340 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
776 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
215 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 ...
12
votes
2answers
15k 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 ...
9
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
170 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
411 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
337 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
3k 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
658 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
12k 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
581 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
537 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
2k 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
670 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
157 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
233 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 ...