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
votes
1answer
58 views

Continuous Log Rotation

I have implemented Log rotation as :- /data/mule/logs/*.log { rotate 1 size 20M missingok noolddir nomail notifempty create 644 root root compress } But the ...
17
votes
7answers
6k views

Continuously monitor logs with tail that are occasionally rotated

We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease. As far as I understand, the problem is that when the log is rotated, there is a new ...
-1
votes
1answer
20 views

Logrotate is not working centos 6.6

I have the following configuration for logrotating the app logs. /opt/tomcat/logs/app-web.txt { copytruncate daily size 500M compress delaycompress rotate 0 missingok ...
2
votes
2answers
17 views

Rotating a subset of logs with Logrotate

I have a number of files in /var/log/myapp/ that end in .log. So I've created a /var/log/myapp/*.log { daily create 644 rotate 90 compress missingok } And this works perfectly well. I ...
-3
votes
1answer
25 views

Daily logrotate doesn't keep the old logs

On a CentOS 6.x I created a simple service called logtraffic which, when started, appends the output of a tcpdump command to a log file at /var/log/logtraffic/logtraffic.log. I want to achieve the ...
6
votes
5answers
8k views

Mongodb - proper way to rotate logs

Mongo docs say that I can: use -SIGUSR1 signal and get the old log renamed and current switched use logrotate from OS I want the OS's logrotate ability to zip old files and remove oldest, but see ...
0
votes
2answers
61 views

Logrotate not rotating

I have set new conf for logrotate, but I just couldn't get it working. Here's my logrotate: /home/deployer/abc/shared/log/*.log { daily missingok rotate 30 compress delaycompress size 5M ...
10
votes
2answers
9k 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 ...
1
vote
0answers
40 views

Cron not logrotating for cron.daily

I'm running a rhel7 server and I have a rsyslog logrotate config file that doesn't seem to run using cron job. It will only work if i run it manually Troubleshooting steps i took: logrotate -df /etc/...
28
votes
5answers
29k 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?
0
votes
0answers
27 views

Odoo: reopen log files for external logrotate

We'd like to use logrotate (the standard tool, not Odoo's configuration parameter) to manage rotation of odoo.log: that usually means having the application close and reopen its log file in order to ...
1
vote
2answers
431 views

Daily logrotate error creating unique temp file: Permission denied

I have a CentOS 6.7 box that for some reason fails to rotate logs daily. I'm getting an e-mail similar to this one every day in /var/mail/root: To: root@server.nl Content-Type: text/plain; charset="...
5
votes
1answer
10k views

manually rotating logfile with rsyslogd

I want to force logfile rotation using logrotate -f /var/log/syslog, but it's only return tones of: error: syslog:1 unknown option 'May' -- ignoring line error: syslog:1 unexpected text I know that ...
3
votes
4answers
3k views

Where does logrotate save their own log?

I have a logrotate running into a EC2 AWS machine rotatting Apache logs. Once packed, apache logs are saved into AWS S3 via s3fs. The problem is that I recetly noticed that I didn't have logs rotated. ...
9
votes
4answers
7k 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: /var/log/mylogfile....
2
votes
2answers
1k 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
58 views

How to compress and remove olde compressed files using logrotate when the file has a date in its name?

I'm generating files daily named as my_file_YYYYMMDD.csv (for instance, my_file_20160406.csv, my_file_20160407.csv and so on). I want logrotate to compress them daily and that it keep just the last ...
0
votes
2answers
64 views

Apache2 logs are not rotating

My apache log files on my Ubuntu 14.04 machine in the /var/log/apache2/ do not seem to be rotating. I had this problem in the past and had to manually rotate the log file, but it looks like it still ...
4
votes
3answers
8k 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 /etc/...
0
votes
1answer
108 views

systemd, logrotate and PID-files

I'm packaging some daemon for debian 8 and systemd. The daemon can create PID-file by itself, but it has no permissions to write into /run because of non-root user. It used to create PID-file via old ...
4
votes
4answers
1k 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 ...
1
vote
0answers
109 views

logrotate as non-root user for files with various owners

I have a collection of log files with various owners. Each log file corresponds to one of a suite of programs, and the permissions are group writable so that whoever starts the program(s) can write to ...
6
votes
2answers
2k views

How to stop logrotate from changing the rotated logs owner

I have a logfile owner by the 'apache' user that I would like to rotate with logrotate. I would like to do that by running logrotate as a different user, say 'web' using the copytruncate strategy. ...
1
vote
1answer
41 views

Why doesn't logrotate's filename globbing pick up files with spaces in their names?

If I specify *bar* {} logrotate will match foo-bar.log but not foo bar.log. From what I have read, logrotate's globbing should behave like shell globbing, so to test I have run ls *bar*. However, ...
0
votes
1answer
346 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: "/etc/logrotate.d/...
-1
votes
1answer
71 views

rsyslog limit log size

Is this even possible to do in rsyslog? http://www.rsyslog.com/doc/rsyslog_conf_output.html This syntax is not working: mail.* -/var/log/mail.log:300M I need to set this limitation ...
0
votes
0answers
20 views

Logrotate does not work daily, but the status file says it does

This is my logrotate script: /var/log/pyApi.log /var/log/runGet*.log { daily missingok rotate 7 compress notifempty nocreate su } Already checked /var/lib/logrotate/...
15
votes
4answers
17k views

Logrotate not working

I am trying to get logrotate to work on my VPS to rotate my apache files weekly. Currently the contents of the apache2 config file is as such. "/var/www/user/site.com/logs/*.log" { weekly ...
34
votes
4answers
8k views

Equivalent of logrotate on OSX

Is logrotate hiding somewhere on OSX, or is there an equivalent? It's not in /usr/sbin.
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 configuration, I have delaycompress enabled. Does Apache really need this (as the logrotate documentation ...
4
votes
4answers
19k 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 ...
2
votes
2answers
85 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 ...
1
vote
2answers
6k views

Logrotate: rotate all log files on specific size and rotate hourly

My logrotate file on ubuntu runs daily. I want to make sure its rotating log files in every hour to get no full disk error anymore. So my logrotate file is in the cron.daily folder, is it enough to ...
11
votes
3answers
6k 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 ...
1
vote
1answer
46 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
131 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
127 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 ...
1
vote
1answer
154 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
363 views

MySQL replication & logrotate

I'm using MySQL Master-Slave replication for backup purposes (for a few days). Today after changing to expire_logs_days = 3 on master and slave I got this message (from slave): /etc/cron.daily/...
4
votes
2answers
528 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 ...
0
votes
2answers
34 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
34 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
69 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 ...
0
votes
3answers
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 ...
7
votes
1answer
5k 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 ...
3
votes
1answer
56 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
20 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 ...
3
votes
2answers
3k views

logrotate is not executing custom shell script in postrotate

I have following logrotate configuration file /home/application/*/shared/log/*.log { daily rotate 10 missingok nocompress notifempty copytruncate sharedscripts postrotate echo "Hi....
1
vote
1answer
74 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
2answers
146 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 ...