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

0
votes
0answers
5 views

Who was the original author of logrotate and what year was it written? [migrated]

The question started as an internal team debate. But we realized we couldn't find any information about when the original version of logrotate was authored and who wrote it. Any idas?
0
votes
0answers
10 views

Using logrotate to ONLY delete logs that are managed/rotated by another service

There are many programs out there that manage log file rotation by themselves. Many of them however only rotate the log and never delete them, and assume that is just part of the sysadmin's job and ...
1
vote
0answers
12 views

MongoDB Backup & purge

I'm exploring solutions for a basic dbadmin need : periodically backing up and purging data in MongoDB. Basically, I need a logrotate for mongodb. I have a backend program filling a collection. I ...
0
votes
0answers
5 views

Unable to get structured data in logged messages even after adding mmpstrucdata and mmrfc5424addhmac?(RFC5424)

I am trying to log messages with structured data . But it is showing null value for structured data. I am working with rsyslog 8.9.0.Can someone tell me either i need to load some module or modify ...
0
votes
2answers
38 views

rsyslog with logrotate: reload rsyslog vs copytruncate

I'm working on Ubuntu 14 with the default rsyslog and logrotate utility. In the default rsyslog logrotate /etc/logrotate.d/rsyslog config I see the following: /var/log/syslog { rotate 7 ...
0
votes
1answer
33 views

logrotate advanced date in daily rotations

I have set a logrotate config file like this: /var/log/tomcat/catalina.out{ copytruncate daily dateext rotate 10 missingok notifempty } And in my /sysconfig/cron settings file I have set ...
-1
votes
1answer
36 views

use awk to execute logrotate command when disk is full

What I'm trying to do is manually run logrotate when my disk is greater than 90% full. I'm trying to do this using df -P and awk. I can get it to display the percentage, if it's > 90, but I can't ...
1
vote
1answer
39 views

Cent OS logrotate is not rotating httpd log

My /etc/logrotate.d/httpd file content is /var/log/httpd/access.log { size=50M dateext maxage 90 postrotate /usr/bin/killall -HUP httpd ls -ltr /var/log/httpd/ | mail -s "$HOSTNAME: Apache ...
0
votes
1answer
59 views

Syslog-ng and Logrotate creating sparse files

We've been using syslog-ng to log our postgres logs. On top of it we run logrotate every 5 minutes which also gzips the files. Recently, we've noted that these postgres logs contain a lot of null ...
0
votes
1answer
54 views

Logrotate executes postrotate even if file not rotated

I have a problem with my rsyslog and imfile that fails when one of my log file gets truncated.. So to workaround the problem I have modified the logrotate script as follow: ...
0
votes
0answers
45 views

Rsyslog last line of old log retransmitted after log rotation

I have config setup on all my CentOS servers to forward all syslog messages to a Graylog server via rsyslog. In Graylog I have then configured streams to alert on the occurrence of certain message ...
2
votes
2answers
99 views

SELinux - logrotate is not rotating NGINX logs

I am using CentOS, NGINX and Passenger to serve a Rails application. I have SELinux activated, and have had a series of problems with logrotate. I have been able to resolve most of the issues by ...
0
votes
2answers
69 views

logrotate syntax error near unexpected token `20'

I cleared out my apache logs last week and now started to get these errors. Any ideas how I can fix this? /etc/cron.daily/logrotate: logrotate_script: -c: line 1: syntax error near unexpected token ...
1
vote
1answer
63 views

How to specify exceptions from wildcard settings in a logrotate configuration file?

For my logfiles I have the problem of all but one (or a few) files use the same configuration, while the rest has another one. I tried to realize this by giving a general configuration for all files ...
1
vote
1answer
80 views

Rotate log files with timestamp in file name

I have a log directory that my app writes into. It creates a log file like this: 2015-01-22-10-full-activity.log 2015-01-22-11-full-activity.log 2015-01-22-12-full-activity.log ...
2
votes
1answer
159 views

Why is logrotate deleting my logs?

This is my conf: /var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm ...
2
votes
2answers
207 views

How does one manually rotate log without logrotate on open/live file?

My Google-Fu is getting me so close but just not quite there, and I guess I'm too green in Linux to put the pieces together. I have a very large >200GB log file, still being written to. Logrotate ...
0
votes
1answer
231 views

Linux: How to enforce specific permissions on newly created logs which are created by log rotate?

I've noticed that the mail logs which are being created in /var/log are being created and owned by root (user and group). I've wrote a Nagios check which monitors the log and in order to allow Nagios ...
3
votes
2answers
48 views

logrotate not emailing log

My logs are being rotated properly, however, I am not being emailed the rotated log. What am I doing wrong? My main logrotate.conf is: include /etc/logrotate.d here is my ...
1
vote
1answer
78 views

Logrotate wildcard with many users and virtual hosts

I'm hosting multiple apache virtual hosts, with similar structure: - /var/www/ - domain - documentroot - logs I've thus modified rule in logrotate.d/apache2 to start with ...
0
votes
1answer
31 views

Configure logrotate to shrink file in user's folder?

All my users in /home/{user}/ have a specific error_log file in it that may grow overtime. So I was thinking about using logrotate to implement some kind of file reducing on it : when the file ...
-2
votes
1answer
57 views

How to let logrotate skip non-existent and empty files

We have the following pronblem. Once in a while, our application server spits out an empty logfile or (when it's in the weekend), there is no logfile at all. We use logrotate for managing these ...
5
votes
1answer
206 views

Cron daemon reporting “unknown user 'tomcat6'” every day since I removed tomcat

I'm running Ubuntu 12.04. Since I removed tomcat via aptitude purge the other day, I keep getting the following error from Cron daily: /etc/cron.daily/logrotate: error: tomcat6:7 unknown user ...
-1
votes
1answer
61 views

logrotate continuous write issue [closed]

i am having issues with logrotate rotating a log file that is being constantly written to. i am using copytruncate option and it gets the job done properly on first rotation but after that, all new ...
2
votes
1answer
1k views

nginx logging to access.log.1 instead of access.log, logrotate failing?

I have an nginx instance that is set to log access to /var/log/nginx/access.log and errors to /var/log/nginx/errors.log, but as soon as logrotate runs each week, the file gets moves to *.log.1 and the ...
0
votes
1answer
40 views

Why logrotate makes an extra rotation?

Trying to configure logrotate for 10 daily rotation in my dump folder I have 11 rotations (mydump.sql, mydump.sql.1 ... mydump.sql.11), why? This is my logrotate configuration file in ...
0
votes
1answer
182 views

Making logrotate remove old logs after reducing 'rotate' value

I'm trying to reduce the number of log files kept for Apache by reducing 'rotate 52' in /etc/logrotate.d/apache2 to 'rotate 8'. With weekly rotation this should keep 2 months of logs instead of a full ...
0
votes
1answer
234 views

Rotating a nohup.out logfile

There are a few questions on how to rotate the output file generated by nohup. Most of the answers say to use logrotate with the copytruncate option. However this does not actually work -- when the ...
1
vote
1answer
69 views

Apache logrotate with different names for current and archives

I'm running Apache 2.2 on CentOS 6.5 and what I'd like to do is have Apache's current access log file be: /var/log/httpd/access_log And each day at midnight, that file is renamed like so (assume ...
0
votes
1answer
122 views

logrotate output to /dev/null twice?

So I was checking my logrotate config for httpd, and, in the section postrotate ... endscript it has the following: /sbin/service httpd reload > /dev/null 2>/dev/null || true I understand the ...
1
vote
0answers
51 views

Postrotate “error running shared script”

Morning all, I realise this question has been answered already but the fix does not seem to work in this case so I'm hoping you guys can help. This this is the error I'm getting: error: error ...
3
votes
0answers
1k views

Why is logrotate causing Apache to seg fault each time?

Every time logrotate runs Apache/2.4.7 (Ubuntu) experiences a seg fault and does not restart: [Wed Sep 10 06:35:54.266018 2014] [mpm_event:notice] [pid 20599:tid 140630283466624] AH00493: SIGUSR1 ...
1
vote
1answer
107 views

logrotate: neither rotate nor compress empty files

i have just set up an (r)syslog server to receive the logs of various clients, which works fine. only logrotate is still not behaving as intending. i want logrotate to create a new logfile for each ...
0
votes
1answer
121 views

How to rotate log files when running pyapns and twistd

I use pyapns (Iphone push server) which in turn uses twisted (twistd daemon). twistd daemon produces twistd.log files. It rotates them to twistd.log.1, twistd.log.2 and so on when twistd.log reaches ...
0
votes
1answer
330 views

Configuring Logrotate for Fluentd files. Necessary?

I have the following fluent.conf <source> type forward </source> <source> type monitor_agent port 24220 </source> # Listen DRb for debug <source> type ...
0
votes
1answer
206 views

PDNS log rotation

I wonder what's the recommended way to rotate PowerDNS log files. I added the following entry to logrotate: # cat /etc/logrotate.d/pdns /var/log/pdns/*.log { daily rotate 7 compress ...
0
votes
0answers
85 views

How to make permission of mysql log file stick?

I am running a custom cron script to do log rotation and email newly compressed log files. Due to permission problems, I have to set the group user to root instead of the default mysql so that the ...
0
votes
1answer
46 views

Rotate whole /var/log

I want to rotate the whole /var/log folder on my server every day so I have the /var/log folder and compressed files like "log.1.gz" which contains the whole directory. I can't found anything on the ...
0
votes
1answer
69 views

apache error logs issue

I have a vps server but the vps provider stop managed service. I having problem with logs file. Every thing seems was alright, but after few month auto logs deletion does not working. Every minute the ...
13
votes
3answers
1k views

How to continue redirecting stdout to a file after logrotate moves it?

I have a simple script which outputs a bunch of logs to screen and I piped the STDOUT to a file to store the logs. Since this script is long running, I needed to rotate the log files so they are ...
3
votes
1answer
225 views

Why auth.log gets rotated multiple times every day?

I noticed a suspicious behaviour of my auth.log. For some reason it is getting rotated multiple times everytime it should rotate. 2014-06-15 06:25:06,102 fail2ban.filter : INFO Log rotation ...
1
vote
4answers
543 views

Logrotate appends “1” at the end of compressed file

I have a script which runs as a cronjob every 30 mins and takes mysqldump of some tables. The dump files are stored in /var/log/ as ...
0
votes
0answers
63 views

Apache logging: Are there any alternatives to piped logging that allow for automatic compression?

Are there any alternatives to Apache's rotatelog that will also compress logs? Logrotate is not an option due to requiring a restart. Ideally this would be a utility that can be used to pipe logs from ...
1
vote
2answers
218 views

How to go about rotating logs which are arbitrary named and placed in deeply nested directories?

I have a couple of hosts which are basically a playground for developers. On these hosts, each of them has a directory under /tmp where he is free to do all he wants - store files, write logs etc. Of ...
2
votes
1answer
925 views

Rotate haproxy logs

I tried few things but still not able to rotate haproxy logs efficiently. I need to rotate logs when log files crosses 500 MB size. Considering haproxy is serving large no. of static tcp connections, ...
0
votes
0answers
299 views

Remove old logrotate entries

Recently I have removed nginx on my server running Debian Linux and since then, I keep getting the following email every day: root@server:~# tail /var/mail/root Content-Type: text/plain; ...
0
votes
0answers
191 views

How do I go about rotating nginx + passenger logs?

I've got nginx with passenger running on debian squeeze. passenger's error output goes to master error log, as you may know. And when logrotate rotates the log, ruby applications continue to write to ...
1
vote
2answers
375 views

Changing LogRotate's default way of rotating the log files

My observation of logrotation is that to rotate any log file, the logrotate process, in the following order copies the log file in question (lets call it file1.log) with a new name (adding time ...
0
votes
1answer
93 views

logrotate mailing of uncompressed logs

The man page of logrotate has this sample configuration file: # sample logrotate configuration file compress /var/log/messages { rotate 5 weekly postrotate ...
0
votes
1answer
33 views

Log not readable after rotation by daemontools

I have a log, which looks perfectly fine. However, after the log rotation by daemontools, it is no longer human readable. What could be the problem?