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
32 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 ...
-1
votes
0answers
18 views

Is there a way to recover lost logs in Nginx? [duplicate]

I have a fedora based server with nginx installed on it. I was taking logs and using logrotate, rotating them on a daily basis. Here's the configuration /etc/logrotate.d/nginx: /var/log/nginx/*log { ...
11
votes
3answers
400 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 ...
0
votes
1answer
39 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 ...
2
votes
1answer
45 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
1answer
647 views

Apache, logerror and logrotate: what is the best method?

Here's a vhost example of my sites: <VirtualHost *:80> DocumentRoot /datas/web/woog ServerName woog.com ServerAlias www.woog.com ErrorLog "|/httpd-2.2.8/bin/rotatelogs ...
0
votes
1answer
652 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 ...
1
vote
4answers
205 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
19 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 ...
0
votes
1answer
27 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 ...
1
vote
2answers
156 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
43 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
35 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
23 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
57 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
70 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
vote
2answers
112 views

unidentifiable httpd log rotator

I have my own server instance which is centos 5.7 and have installed apache some time ago. Now I noticed that my log files are rotating. I couldn't remember if I had set up something or not since ...
0
votes
1answer
14 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
139 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
4answers
2k views

nginx logrotate config

Whats the best way to rotate nginx logfiles? In my opinion, I should create a file "nginx" in /etc/logrotate.d/ and fill it with the following code and do a /etc/init.d/syslog restart after that. ...
1
vote
1answer
204 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 ...
12
votes
3answers
8k views

logrotate daily and size?

If a logrotate config is specified with "size" and "daily" parameters, which one takes precedence? Where is this documented? I would like these rotations to occur as a boolean OR operation, ie, if the ...
2
votes
1answer
184 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 ...
3
votes
3answers
86 views

logrotate security

Are there any concerns about the security of logrotate running as root? Had someone ask couldn't a malicious user subvert the config to overwrite anything? Is is okay to run logrotate out of the ...
1
vote
1answer
145 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
216 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-- ...
-3
votes
2answers
682 views

Logrotate error for fail2ban

I get the following error when running a cron job, and I'm not too sure how to go about fixing. This is on Ubuntu 12.04 LTS. test -x /usr/sbin/anacron || ( cd / && run-parts --report ...
1
vote
1answer
100 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 ...
5
votes
2answers
2k views

Can postgres internal log rotation mechanism delete log files older than a certain time?

I am using posgtres' internal log rotation mechanism. I would like log files older than 30 days to be deleted. How do I get postgres to do this? If postgres does not support it, can I set logrotate to ...
1
vote
2answers
60 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
42 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: ...
-1
votes
1answer
42 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 ...
0
votes
3answers
1k views

Why is logrotate not rotating logs Tomcat access logs on aws centos 6.3?

I have the following file in /etc/logrotate.d: /usr/share/apache-tomcat/logs/*.access { nodateext copytruncate daily rotate 7 notifempty postrotate EXT=`date --date='-1 day' +%Y-%m-%d` /bin/gzip $1.1 ...
2
votes
4answers
3k views

Daily Weekly and Monthly DB backup with logrotate?

I am currently keeping daily backup of my database by doing a daily mysqldump and by using logrotate to keep the 7 last days of mysqldump. I would like to improve this backup process to keep 7 daily ...
9
votes
2answers
3k views

Logrotate: how to access the output file in postrotate

I rotate Nginx logs daily (with dateext). After the rotation I want to parse the file for the day that just passed and compile an email with the number of errors returned by Nginx server. How can I ...
0
votes
1answer
61 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 ...
1
vote
2answers
846 views

Preventing logrotate's dateext from overwriting files

I'm working with a system where I would like to use the dateext function of logrotate (or some other way) to add the date to a logfile when it is rotated. However in this system it is important that ...
0
votes
1answer
57 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
48 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
88 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
1answer
183 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 ...
0
votes
0answers
70 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
74 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 ...
7
votes
2answers
5k views

Equivalent of LogRotate for Windows?

We have a huge logfile being written by a vendor's application. Let's assume the vendor won't do anything that we ask. Is there any way of rotating that logfile somehow? We're looking at about 300 MB ...
0
votes
1answer
25 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
118 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? ...
3
votes
1answer
916 views

How can I specify multiple rules for a particular log file(s) with logrotate?

I have a logrotate.d config file that looks something like this: /home/myapp/log/* { daily compress dateext ifempty delaycompress olddir /home/myapp/baklog } There are a few ...
1
vote
2answers
82 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
64 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 ...