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

9
votes
2answers
3k views

MySQL doesn't logs error to new file after rotating?

Problem solved but I'm writing down for the future reference. /root/.my.cnf [mysqladmin] user = root password = pa$$w0rd /etc/logrotate.d/mysql /var/log/mysql-slow.log ...
1
vote
2answers
316 views

nginx - log access and error to pipe and use multilog to log rotate

What I am trying to do: Log rotate nginx access and error log using multilog My approach: Log nginx access and error to a pipe, so I can have another process that runs multilog that reads from that ...
2
votes
1answer
455 views

logrotate not deleting old files - glob failing

I'm stumped with this one. Any help is much appreciated...! Logs in /var/log/HOSTS/cacheflow_access_log/ are configured to archive to /var/log/HOSTS/archived/cacheflow_access_log/ and compress. These ...
0
votes
1answer
840 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 ...
6
votes
2answers
299 views

Logrotation - postrotate firing too soon?

I have a configuration file that looks like: /var/log/nginx/*.log { daily missingok rotate 90 dateext compress notifempty create 644 root adm ...
-2
votes
2answers
94 views

Compress files with logrotate [closed]

I have a directory structure which contains files already rotated (eg. there is a date part applied to the end). I would like to compress them and keep only 7 of each file type. Is this achievable ...
2
votes
0answers
95 views

Logrotate directories (not files)

I have an application creating logfiles in a structure like this: maillog/ 2012-07-02/ production_environment-2012-07-02__23_51_50-1341265910-some name.log ...
0
votes
2answers
1k views

Logrotate httpd (apache) logs - Possible without reloading httpd after log purge?

Lets start with a small dump: /var/log/httpd/*log { compress missingok notifempty sharedscripts delaycompress postrotate /sbin/service httpd reload > /dev/null ...
1
vote
1answer
606 views

Logrotate get created file name

I can produce file truncated from original log file with timestamp extention (%y%m%d%s). How can I get the name of created file in order to use this name in 'postrotate'. The following conf file does ...
1
vote
1answer
190 views

logrotate: how to detect failure

# logrotate -d /etc/logrotate.conf ... reading config info for /var/log/rsyncd.log error: rsync:12 duplicate log entry for /var/log/rsyncd.log error: found error in /var/log/rsyncd.log , skipping ...
13
votes
4answers
10k 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 ...
0
votes
1answer
412 views

logrotate not rotates my logs

my logrotate works perfectly, except for this configuration: /var/awdata/awarchive.*.log /var/log/awstats.log { rotate 12 } this is my logrotate -d /etc/logorate.conf considering log ...
3
votes
1answer
4k 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 ...
10
votes
2answers
6k 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 ...
4
votes
1answer
1k 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 ...
2
votes
1answer
235 views

logrotate> removing delaycompress function: should I compress the last log myself?

I'm removing the delaycompress function from my logrotating script. Before running logrotate again, should I compress the last log myself ? This is the actual situation: -rw-r----- 1 root adm 4,7M ...
1
vote
2answers
147 views

Advice on apache log files

I have a small VPS that a friend and I use to host a few websites. We are both relatively inexperienced with server management and are unsure of an effective way to deal with the logs that Apache ...
2
votes
2answers
907 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. ...
3
votes
3answers
91 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 ...
4
votes
1answer
3k 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 ...
7
votes
3answers
6k views

logrotate not rotating the logs

I have this logrotate config and I am running on Ubuntu 10.04. /var/log/mysql/mysql-slow.log { daily rotate 3 compress notifempty missingok create 660 mysql adm postrotate ...
8
votes
3answers
435 views

Free-space driven log rotation on linux?

Someone just asked me 'how long should we keep logs for our application', and my answer was 'until the disk is full' as there's no reason to throw them away other than running out of space. However, ...
0
votes
1answer
243 views

Memcached logrotate file not being installed. Bug with memcached 1.4.2?

My memcached logs are getting huge (in excess of 5GB). This isn't a huge problem in itself. I can easily remove them. I've sourced the problem to the memcached 1.4.2 package not installing a ...
3
votes
1answer
194 views

Can I manually compress file when logrotate with delaycompress is active

I have a daily logrotate set up with compress, missingok, delaycompress, dateext options. I need to compress the delayed log file. Can I do it manually now or should I wait till logrotate does it when ...
0
votes
1answer
559 views

using logrotate on win7 with cygwin

I am using the famous logrotate with windows 7 and cygwin, I have the latest cygwin dll but somehow the app doesn't work for me, and the config file seems to be ok. Has anyone encountered this before? ...
0
votes
1answer
198 views

setting logrotate to use UTC time

Is it possible to force logrotate to use UTC time for one configuration? I need the dateext to be set to UTC. I was hoping it was as simple as setting a date varible. Should I just run postrotate and ...
0
votes
2answers
391 views

Apache Log Rotation

Is there any mod or program for Apache Httpd which rotate logs as well as purge them without the restarting of server processes? I have checked a few options, mod_autorotate, rotatelogs, ...
0
votes
2answers
252 views

Logrotate won't rotate logs with a space

I have a log file a service of mine makes that has the filename "Feed1 - 1.stat". logrotate refuses to rotate this file, but only when run via cron. Running logrotate via the shell will rotate the ...
9
votes
3answers
6k 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 ...
1
vote
3answers
2k views

Apache becomes unresponsive on Sundays

For some reason, most Sundays around 5-6AM local time Apache is not working properly. I can't find the reason, and I'm stuck troubleshooting. I'm running Magento on Apache2 with an SSL certificate, ...
16
votes
3answers
3k views

Equivalent of logrotate on OSX

Is logrotate hiding somewhere on OSX, or is there an equivalent? It's not in /usr/sbin.
5
votes
5answers
232 views

How should I deal with logs before they get to big?

I found out my disk was full today, and I freed up 10% just from deleting mostly logs from multiple websites. I, personally, like to keep logs as an archive, because I may need to look back on them ...
2
votes
2answers
231 views

Best Way to Keep Up on Linux Log Files

I run multiple Linux (Ubuntu) web servers and am looking for a convenient way to keep tabs on important log files. I'd like to monitor pertinent LAMP logs as well as server accesses/logins. Are there ...
0
votes
2answers
696 views

logrotate fails to instruct Apache to reopen logs on Amazon Linux

I have very good experience with logrotate normally, but on a recent installation using "Amazon Linux" (CentOS 6 deployed by Amazon) on EC2, logrotate fails to cause Apache to reopen its logs. The ...
1
vote
2answers
116 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 ...
1
vote
1answer
370 views

Mail logs files as attachments with sendmail

I'm using logrotate to rotate my log files. I've set it up to create new logfiles every week. However I would like it to first mail me the logfiles as attachments. The /var/log/httpd file currently ...
1
vote
1answer
390 views

nginx host server log rotation all sites

I have setup individual log files for each of my sites in the directory /var/log/nginx-hosts/ and I have to configure log rotation for those files. The base I am starting with is ...
2
votes
1answer
512 views

logrotate compress only last n logs

I need to make daily rotate /var/log/messages to be kept for 60 days, last 30 logs must be compressed with bzip2. That's my logrotate config: /var/log/messages { ...
3
votes
1answer
2k views

FreeBSD 8.1 64bit logrotate - ELF interpreter /libexec/ld-elf-so.1 not found

I am trying to get logrotate running on a FreeBSD 8.1 virtual machine. I installed the logrotate with pkg_add, I have created the logrotate.config file and also run: mkdir /var/lib/ touch ...
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 ...
0
votes
1answer
173 views

can logrotate process all *.log in a directory tree?

Logrotate can work on individual files or wildcarded files (*.log, for example) in a specified directory, but does it inherently have the ability to traverse a directory tree of arbitrary depth and ...
0
votes
2answers
88 views

apache access.log to keep only records from last 3 monthes

I need Apache accesslog file to be parsed fast in realtime and always to keep only last 3 months data. So I need tool which everyday cutting old records(and moving them to another file) from log file ...
1
vote
1answer
181 views

How do I work around the fact that Apache needs to be restarted to rotate the logs?

It seems so "primitive" that HTTPD has to be restarted just to rotate the logs. There has got be other ways to accomplish this! Note that I do not use nor wish to use AWStats, one of the ways to ...
1
vote
1answer
1k views

What process creates the access_log.processed file

We are having some problems with log rotation on our Centos box. We've configured the server to perform a logrotation every day and keep the logs for 30 days. In our log folder, every day a file ...
0
votes
1answer
255 views

How to make logrotate keep the last week into the current .log

Is it possible to get logrotate to keep the last week of logs in the current file? for example : errors.log contains 30 days of logs after log rotate executes , I would have : errors.log with ...
1
vote
1answer
5k 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 ...
1
vote
1answer
602 views

Varnish logrotate issue

I have this in logrotate.d/varnish file: /var/log/varnish/*log { create 640 http log compress postrotate /bin/kill -USR1 `cat ...
0
votes
1answer
187 views

Understanding logrotate's create directive

There is a web application (php/apache2) which opens a log file somewhere at a start of a request handling and closes it (as far as I know) when the handling is finished. Between log file open and ...
8
votes
2answers
10k views

When to use delaycompress option in logrotate?

The man page of logrotate says that: It can be used when some program cannot be told to close its logfile and thus might continue writing to the previous log file for some time. I'm confused by ...
2
votes
3answers
1k views

Preferred format of file names which include a timestamp

As we all know "unix" can have anything in a file except '/' and '\0', sysadmins however tend to have a much smaller preference, mainly due to nothing liking spaces as input ... and a bunch of things ...