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
11 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 ...
-1
votes
0answers
13 views

Apache rotatelog including port number in the log file name

I have configured Apache rotatelog to create a new log file every minute. Is there any way to obtain the port number as one of the parameter in the log file name - like log_TIME_PORTNUMBER.log ...
0
votes
1answer
30 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
25 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
33 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
16 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
22 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 ...
2
votes
0answers
93 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
48 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
40 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
65 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
49 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
36 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
39 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
56 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 ...
12
votes
3answers
630 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 ...
2
votes
1answer
79 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
277 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
27 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
180 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
285 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
109 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
71 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
175 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
43 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
23 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?
0
votes
1answer
429 views

Logrotate for node.js app deployed using monit and upstart

I deployed a web application in node.js by following the guide: Deploying Node.js With Upstart and Monit . The app produces some log via console.log(). In the upstart script, it's redirected to a log ...
2
votes
1answer
529 views

SELinux permissions for LogRotate and Apache

With the directory structure: /www/live/website1/app/ /www/live/website1/files/ /www/live/website1/logs/ Where Apache needs at least the following access: app: read-only access, but read-write is ...
2
votes
1answer
295 views

Manually rotate a log file

I have an Ubuntu web server running Nginx. I had never configured logfile rotation and have just discovered some multi-gigabyte monolithic log files. I have configured log rotation now per these ...
1
vote
1answer
419 views

Squid3 logrotate error in Ubuntu 12.04

In a Ubuntu 12.04 server, logrotate for Squid3 is not working. I have found the problem while noticing the partition is getting full from squid3 logs. A forced logrotate yields the following error: ...
1
vote
1answer
476 views

Logrotate: Postrotate setfacl failed with no such file or directory error

I set some extended ACL entries for /var/log/squid3/ and /var/log/squid3/access.log. sudo setfacl -m u:jetty:r-x,g:adm:r-x /var/log/squid3 sudo setfacl -m u:jetty:r--,g:adm:r-- ...
1
vote
1answer
166 views

Is it possible to schedule a python script to run at the end of logrotate?

I am using Piwik Analytics on a site that doesn't run any javascript and I would prefer to have data created from the access logs instead of from the image tracker - results from the logs are actually ...
0
votes
1answer
102 views

does the sharedscripts setting for logrotate apply to all processed logs, or only those in the current context?

So I have a number of apache logs I like to handle with logrotate on a developer box. Some of them are for user sandboxes, others are for staging versions and such. The logrotate config looks like: ...
0
votes
1answer
127 views

Linux cp with gzip and numbered backup in one step?

I'm wanting to copy a file and gzip it in a single command/step But I want to do numbered backup if the file already exists i.e. "cp --backup=numbered" or similar. The reason for the single step is ...
-1
votes
1answer
46 views

Web server stops logging [closed]

I have Virtual Hosts set up so that each VH has its own set of logs for access and errors. For some reason, these stop logging and returns to the default server logs randomly after logrotate kicks in ...
1
vote
2answers
122 views

Log rotate log from standard out

I have a program which takes an argument to allow extra debug from a piece of hardware we use. The log is just written to standard out so normally we just pipe the standard out to a file i.e. ...
0
votes
1answer
113 views

logrotate httpd on centOS 6.4

I am attempting to set up logrotate. I am getting unexpected results; some log files have multiple dates and/or zero bytes in size. I would like to have a log for each day and have the date in the ...
0
votes
1answer
75 views

Logrotate Ubuntu 12.04 LTS [closed]

Is logrotate set up by default on Ubuntu 12.04 LTS? Or do I need to configure it? I can see /etc/cron.daily/logrotate so I guess it should be working out of the box? Is it rotating all files inside ...
1
vote
2answers
68 views

Rotatelogs rotating log files mid log entry

I have a c++ tool that outputs to STDOUT via printf i.e. printf ("%s\n", logline); I then pipe that to rotatelogs i.e. tool | rotatelogs /tmp/logs/log_%s 60 Everything works great, but ...
0
votes
0answers
131 views

/etc/cron.daily/logrotate: line 4: 12425 Segmentation fault

I receive every day this error, I checked with strace, this is output: root@vps2 [~]# strace /etc/cron.daily/logrotate execve("/etc/cron.daily/logrotate", ["/etc/cron.daily/logrotate"], [/* 27 vars ...
0
votes
0answers
103 views

Sleeping for a random interval in postrotate in logrotate

I'm having trouble with the following logrotate config. It doesn't seem to want to release that file once it has done it's rotate and I'm wondering it the sleep is messing with the restart. ...
0
votes
0answers
101 views

Logrotate config for a laravel application

I have a laravel application which writes the log file names like log-apache2handler-2013-11-17.txt In my logrotate script, I am doing *.txt however this filename is going to change everyday, so by ...
0
votes
1answer
32 views

log rotation unable to process mailfirst

I have configured log rotation on my Ubuntu server named custom in the directory /etc/logrotation.d/custom the entries are as follows /var/log/apache2/access.log { daily mailfirst ...
5
votes
1answer
142 views

How does logrotate handle concurrency?

In the case that logrotate runs the same time as the log file is being updated, what will happen? Will the new log be rotated into a historical log file? Or it will stay in the current log file? ...
1
vote
2answers
131 views

make logrotate to only rotate at service startup

i'd like to do logfile rotation for whenever i start a service, but never "automatically". i'm running a python-based service that logs to a specific logfile. the service (currently) does not support ...
0
votes
0answers
96 views

Apache2 on Windows - Log Files don't rotate

I've got an Apache 2.4.6 (64 Bit) running on a Windows Server 2012 (64 Bit) machine. I want to achieve a log file rotation every day or if a size of 29MB is reached. As documented on ...
0
votes
0answers
37 views

logrotate by size outside the daily schedule

We have a couple of applications that generate huge log files. It's not enough to rotate those logs daily, so I created the following logrotate conf: /var/log/ourapp/*log { compress copytruncate ...
0
votes
1answer
284 views

Debian cron complaining about log dir ownership since upgrade to Wheezy

I'm getting errors from cron like this: /etc/cron.daily/logrotate: error: skipping "/var/log/apache2/access.log" because parent directory has insecure permissions (It's world writable or ...
4
votes
2answers
2k views

Rsyslog stops sending data to remote server after log rotation

In my configuration, I have rsyslog who is in charge of following changes of /home/user/my_app/shared/log/unicorn.stderr.log using imfile. The content is sent to another remote logging server using ...
-1
votes
1answer
44 views

specify multiple filenames in one line. bash

guys. im trying to add to logrotate files from a some directory. it should be either *.txt files or *_log files. wtat's the right syntax for this: /var/www/html/groupware/horde_logs/[*.txt|*_log]{ ...