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
2answers
71 views

nginx logs just failed weekly rotate, how do I determine why?

After I installed nginx, its logs have been rotating weekly as per a weekly cron job on Sunday 00:00 However this week the logs failed to rotate, and I can't figure out why. The only thing I can ...
0
votes
1answer
25 views

logrotate frequency - when and from when

if have lograte in my daily cron /etc/cron.daily/logrotate -- assume cron.daily is run at 1.05am daily and if my logrotate config has a weekly settings Does it means that my logrotate will ...
0
votes
2answers
24 views

Mongodb log rotation creates an extra empty log file each time it runs

I configured a new mongodb arbiter recently, and used this to test some new mongo config, using the mongo 3 config syntax, at the same time I tested log rotation on the server. This worked nicely: $ ...
6
votes
2answers
97 views

Error with gunzip during logrotate

I'm using logrotate to rotate my Symfony2 logs on my webserver. Everything works fine, but I wanted the old logs to be sent to me by emails. So, I added some line in my logrotate conf file as you can ...
0
votes
2answers
18 views

logrotate issue with date appending

I have an Apache server (2.2) running in RHEL 6.3, with the following logrotate configuration: # Rule for Apache logs /var/opt/apache/logs/*log { compress missingok notifempty daily ...
0
votes
1answer
20 views

postrotate script is not receiving rotated file name

I'm trying to do some processing on an exim log, but my script is not receiving the rotated log file name as a parameter - rather, it's getting the original log file name (which no longer exists) ...
-1
votes
2answers
33 views

Logrotate not run [duplicate]

I use ubuntu 14.04 I try to run logrotate each 10min and remove all logs files bigger then 2MB, I try a lot solution but nothing not work, my logrotate run just 1 per day, I try solution with moved ...
3
votes
1answer
34 views

SELinux allow access for perl script via log rotate

I have a perl script that I want to run as a perorate script for log rotate. When I force log rotate to run from the command line as root, it works. However, when run through cron, SELinux prevents ...
0
votes
1answer
16 views

logrotate saves content to old file

I used logrotate to rotate my log files. The conf file look like this: /data/log/web/12114.log { daily rotate 10 copytruncate } But logrotate doesn't cut the log file properly. The ...
1
vote
1answer
26 views

logrotate - run the postrotate after all processing

I have a logrotate script that is structured to rotate logs collected by syslog. Part of that script is to reload the syslog process. The problem is that the syslog reload runs for each matching log ...
1
vote
1answer
77 views

Logrotate running according to cron, but logs are not rotated

I run logrotate through cron with the script [alex@leia ~]$ cat /etc/cron.daily/logrotate #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf >/dev/null EXITVALUE=$? if [ $EXITVALUE != 0 ]; then ...
0
votes
1answer
19 views

Clearing cached memory of uploaded file

On my system, I have a log file that is being rotated and uploaded every hour. This file is heavy on writes and only needs to be read when rotated and uploaded. The cached memory on my system is ...
0
votes
0answers
8 views

logrotate: missingok-equivalent for include directive

Suppose I have something like the following include /path/to/site_logrotate_config in a logrotate config file that should be the same for several hosts. This works fine as long as there is always ...
-2
votes
1answer
54 views

log files become to big

i use ubuntu 14.04 each 2 day i need manualy remove log files from: /var/log/apache2/domains 2 files become to big about 5gb, i found solution, edit logrotate.conf found in etc/logrotate.conf this ...
1
vote
0answers
36 views

logrotate causes php5-fpm downtime

I've noticed that one of our servers starts returning errors just after logrotate runs, i.e. in nginx error log I can see: [error] 8501#0: *118126869 recv() failed (104: Connection reset by ...
2
votes
1answer
29 views

logrotate says it's running but it's not

I have just set this box up as a log server so I can forward to a SIEM but the file is not rotating the way I expect. /var/log/remote/*.log { daily dateext rotate 4 compress ...
0
votes
1answer
66 views

Logrotate does not work as expected

Default logrotate rules for httpd in my CentOS 6 installation looks like this: [root@myVM ~]# cat /etc/logrotate.d/httpd /var/log/httpd/*log { missingok notifempty sharedscripts ...
2
votes
2answers
60 views

Split large Logfile with Suffix like from logrotate

after I've seen that I forgot to add a logrotate-conf for php5-fpm.log on one Server, and now seeing that it has grown REALLY big, I'm asking myself how to split this Logfile into separate ones, with ...
-1
votes
2answers
137 views

Centos logrotate found error, skipping

One of our servers has a access_log which is nearly 5GB in size - there is currently no log rotation so I enabled it yesterday for httpd The contents of /etc/logrotate.d/httpd is /var/log/*.log { ...
2
votes
1answer
64 views

Unable to enable custom SELinux rule

logrotate is unable to rotate a log file for our application on CentOS 7. This appears to be because of this AVC error: type=AVC msg=audit(1441112694.305:19502): avc: denied { write } for pid=9146 ...
0
votes
0answers
151 views

Where does elasticsearch store graylog2 logs?

I've setup fluentd to stream docker container logs to a centralized graylog2 server. I'm hoping to setup log rotate for these logs. From what I understand, graylog stores these logs in ...
1
vote
3answers
261 views

Apache daily logrotate

I want to create daily logs, but there's a small problem. Logs aren't being created for each day, rather they contain the previous log files. Here's my current setup, how can I change it so it only ...
0
votes
1answer
24 views

Extend “system” logrotate rules without overwriting the package's definition

The package manager installs a logrotate config file under /etc/logrotate.d for Apache2, which contains a create 640 root adm line. I want this to be a bit more liberate, e.g. create 644 root adm. I ...
1
vote
1answer
106 views

Logrotate script not uploading to s3

I am trying to use logrotate to upload log files from my rails and nginx commands once a day. When I run the logrotate command manually the files successfully upload, but it never does it on its own. ...
2
votes
1answer
80 views

logrotate compression parameters

I've been using cstream for a while for many things, for example to reduce the impact that mysqldump has on drives. However, I have always done so by calling the binary directly from a script or ...
0
votes
2answers
42 views

logrotate not workig as expected

I am setting up logrotate & realized that a few of the options are either incorrectly explained/understood. My logrotate rotate 52 keyword is creating 52 files of the same log every time it ...
0
votes
2answers
124 views

Delete files with logrotate

Is it possible JUST to delete the log files in a directory by using logrotate w/o actually rotating them? We have an app that generates logs in the following format: app.log.DD_MM_YYYY. I am ...
0
votes
0answers
68 views

Command with -sigusr1 and kill not restarting gracefully

I have a kill command in my /etc/logrotate.d/php-fpm file: /var/log/php-fpm-5.5.11/*log { missingok notifempty sharedscripts delaycompress postrotate /bin/kill -SIGUSR1 `cat ...
0
votes
1answer
112 views

Syslog logging to syslog.1 not syslog

My syslog file is getting a bit unmanageable. I believed I had configured this previously to rotate daily but obviously something has gone amiss. At the moment, my /var/log looks like this: ...
0
votes
3answers
137 views

How to make a cron script for cleaning up a log file? [closed]

I don't usually do this kind of stuff, so I just have to ask. How do I make a script which checks a log file, lets say it's named log.txt, grabs everything but the first 100 000 lines from it to a new ...
0
votes
1answer
99 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
62 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
249 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
56 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
88 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
1answer
385 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
85 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 ...
1
vote
1answer
235 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
77 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
56 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 ...
1
vote
2answers
2k 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
108 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
85 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
62 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
154 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
225 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
77 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
491 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
232 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
333 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 ...