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
1answer
26 views

How to rotate a log file from crontab?

I have this directive on my crontab: * * * * * /var/www/github/mysite/bin/email email worker await --pid=/var/run/mysite-worker-email.pid >> /tmp/mysite-worker-email.log As you can see all my ...
1
vote
1answer
40 views

Logrotate deleting instead of rotating

This is my logrotate configuration /var/log/abc/*.log { missingok compress sharedscripts create 640 root root postrotate /etc/init.d/abc reload endscript } When i run this manually as logrotate ...
0
votes
0answers
19 views

Logrotate: Error creating outfile, file already exists

I run logrotate in a daily cron, today I got an e-mail about a file already existing error: error creating output file path/to/search.log.2014-10-03.1412289722.gz: File exists But I'm not sure why ...
0
votes
1answer
30 views

Issue with logrotate log based on an interval unless log exceeds a certain size?

I went though few resources in this forum like: How to rotate log based on an interval unless log exceeds a certain size? but, I don't see my log files being rotated daily. their max size for past ...
0
votes
1answer
29 views

How to filter cron messages in syslog-ng

I have a litte problem. I dont know ho to filter cron jobs in syslog-ng. It's spamming my log. Jun 05 16:09:01 CRON: pam_unix(cron:session): session opened for user root by (uid=0) Jun 05 ...
0
votes
0answers
29 views

auditd process stops logging after logrotate script runs

I am trying to use logrotate to keep audit logs for a set period of time rather than using auditd's special rotation (from /etc/audit/auditd.conf). I have changed the max_log_file_action to IGNORE in ...
0
votes
1answer
29 views

Logrotate - how change it so that it never deletes logs and will create a .gz every 6 months?

I read the man logrotate, but it's still unclear to me. My questions are mainly related to the NGINX webserver logs. This is my current logrotate.conf: # rotate log files weekly weekly # keep 4 ...
0
votes
1answer
23 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
24 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 ...
1
vote
0answers
21 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
129 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
39 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
46 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
44 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
79 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
82 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
52 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
141 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
103 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
2answers
101 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 ...
2
votes
1answer
130 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
171 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
325 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
400 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
60 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
83 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
66 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
221 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
63 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 ...
3
votes
1answer
2k 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
44 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
271 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
276 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
75 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
140 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
59 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 ...
5
votes
1answer
2k 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
121 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
134 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
410 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
230 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
88 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
47 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
70 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 ...
14
votes
4answers
2k 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
245 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
611 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
70 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
238 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 ...