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
vote
2answers
237 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
2answers
260 views

Null bytes in a file created by 2> rotated with logrotate?

I'm using the script utility to record terminal sessions, and using logrotate (with copytruncate, script ignores HUP and keeps writing to the rotated file otherwise) to periodically upload chunks of ...
0
votes
2answers
60 views

Logrotater Daily situation

Every day I would like to run logrotate on /var/trafficap/captured/arch/ and zip all the zip packages I have for each day ( its 1 package.zip with a name like this : ...
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 ...
0
votes
2answers
218 views

logrotate pattern matching for daemon restart

In a setup very much like: http://wiki.apache.org/httpd/ExtendingPrivilegeSeparation I have logs located in /var/weblog/<domain>/error_log I would like to use logrotate to rotate these logs ...
2
votes
1answer
121 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 ...
2
votes
1answer
378 views

How backup files with logrotate and Amazon S3?

I would like to create a new standard of two things: how long would be generated and be rotated the logs generated by my applications ? how to transfer the logs to Amazon S3, as a backup server ?. ...
2
votes
1answer
486 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 ...
2
votes
1answer
975 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 ...
2
votes
1answer
240 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
1answer
48 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 ...
1
vote
1answer
475 views

Debugging logrotate postrotate script

Following is my logrotate conf. /mnt/je/logs/apache/jesites/web/*.log" { missingok rotate 0 size 5M copytruncate notifempty sharedscripts ...
1
vote
1answer
380 views

Append date to domain logs with logrotate in Plesk 11

I am using plesk with a Media Temple DV 4.0 Account. It has a GUI to set up log rotation for my domains. However I need to append a date/time stamp to the logs so our stats software importer can ...
1
vote
1answer
51 views

logrotate : Contents are missing

I'm using logrotate to rotate my log file periodically (in my case every 1 hour checking for log file size and rotate if needed using cron). I'm facing a serious issue in it. The following files ...
1
vote
1answer
664 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
4 views

Linux: How to enforce specific permissions on newly created logs which are created by log rotate?

I've noticed that the mail logs which are being created in /var/log are being created and owned by root (user and group). I've wrote a Nagios check which monitors the log and in order to allow Nagios ...
0
votes
1answer
16 views

Configure logrotate to shrink file in user's folder?

All my users in /home/{user}/ have a specific error_log file in it that may grow overtime. So I was thinking about using logrotate to implement some kind of file reducing on it : when the file ...
0
votes
1answer
57 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
468 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 ...
0
votes
1answer
150 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 ...
0
votes
1answer
377 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
1answer
334 views

using logrotate with prerotate/postrotate scripts

I need to deliver csv file with some data which will come from my application. Structure of file shall look like this: time,time,meas_type,meas_val[1],meas_val[2],meas_val[3] ...
0
votes
1answer
136 views

Best way to rotate Magento logs?

We have a lot of sites on Magento and the logs are getting gigantic, so I'm wondering if the best way is to use a cron script to rotate them or logrotate. I want to avoid making file copies as it ...
0
votes
1answer
58 views

Yesterday-access.log is pointing to a different directory

Under /var/log/ispconfig/httpd/quotednews.com/ folder, the yesterday-access.log is pointing to a wrong directory. yesterday-access.log is just a symlink to: ...
0
votes
1answer
166 views

Logrotate rotating daily but should be rotating weekly

For some reason logrotate is rotating logs daily instead of weekly, even though all the config files for logrotate seem to be set to weekly. Any ideas? /etc/cron.daily/logrotate #!/bin/sh test -x ...
0
votes
1answer
211 views

Hosts.deny file not being updated by denyhost service

I have denyhosts running on my server to block IPs that repeated fail to login over ssh, for example brute force style attacks. I can see that entries in the auth.log file have not been updated in the ...
0
votes
1answer
478 views

logrotate deletes all maillogs older than one day

I see only two files maillog and maillog.1 in /var/log. grepping for maillog in logrotate.d directory gives three files that have a mention of maillog. syslog /var/log/messages /var/log/secure ...
0
votes
1answer
269 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 ...
0
votes
1answer
279 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 ...
0
votes
1answer
206 views

Apache, and logrotate instances

If I have one website and I want to rotate its logs, there's one instance of logrotate that is launched. There are as many logrotate instances launched as they are virtual websites. Here you can find ...
2
votes
0answers
303 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 ...
2
votes
0answers
103 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 ...
1
vote
0answers
36 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 ...
1
vote
0answers
1k views

Logrotate doesn't work from cron on CentOS

I have lograotate configured on CentOS 6. It works fine when I run it manually, but with CRON it doesn't work. Cron says in its logs: "All fine, I run you command" but nothing happens. Details: cat ...
1
vote
0answers
316 views

Windows Apache logrotate.conf equivalent for rotatelogs.exe to overwrite logs

Our disk is getting full real fast on Windows with Apache Logs.I want to overwrite old log files so that there are only 10 files at any 1 time with a capacity of 5M each. Is there a way to use rotate ...
1
vote
0answers
281 views

How to configure logrotate to just prune a directory once a week?

How to configure logrotate to just delete all files under selected directory once a week? I'm testing the following: /var/spool/mydir/* { daily rotate 0 nocompress copytruncate } ...
0
votes
0answers
57 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
0answers
32 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
0answers
155 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
117 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 ...
0
votes
0answers
123 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
178 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): ...