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

7
votes
5answers
15k views

logrotate does not compress /var/log/messages

Over time I noticed some logs in /var/log such as auth, kern and messages were getting huge. I made logrotate entries for them: $ cat /etc/logrotate.d/auth.log /var/log/kern.log { rotate 5 ...
4
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 ...
2
votes
2answers
412 views

syslog rotation

I wrote a small c app that uses the syslog c interface to write messages (from man 3 syslog): void openlog(const char *ident, int logopt, int facility); void syslog(int priority, const char *message, ...
5
votes
4answers
4k views

Exclude files / dirs logrotate

I am logging all our applications logs to /logs/, where all our applications have an seperate directory. I have made a custom logrotate file as follows: /logs/*.log { daily missingok rotate 1 ...
2
votes
2answers
352 views

Two scripts in /etc/cron.daily seem to be rotating my logs: logrotate and sysklogd

It seems that my logfiles generated by syslog are getting rotated twice each day. I believe this is due to both /etc/cron.daily/logrotate and /etc/cron.daily/sysklogd doing overlapping work. Here are ...
3
votes
1answer
5k views

How do you rotate apache logs on windows without interrupting service?

I administrate a Windows Server 2003 (Standard Edition, 32-bit) installation running Apache2 and ColdFusion. The server has over 100 virtual hosts, each with an access log and an error log. I've been ...
3
votes
3answers
3k views

Logrotate creates long names and does not delete logs

postgres_db_dump_20091016.gz.1.1.1.1.1.1.1.1.1.1.1-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021 ...
4
votes
2answers
4k views

Why do JBoss and Logrotate create log files full of NUL characters?

I've set up Logrotate to rotate my JBoss Application Server 4.2.2.GA logs nightly. After the log files have been rotated and JBoss starts writing to them again, the new log files begin with as many ...
1
vote
1answer
181 views

Compressed email attachments for logrotate

How can I configure logrotate so that it emails me the files 'after' they have been compressed? Right now I am emailed the uncompressed files which can results in huge attachments.
1
vote
8answers
948 views

Weekly Cron / Logrotate / Denyhosts error

I am getting the following error email every week. It appears to be a problem with either cron, logrotate, or denyhosts. I'm not sure which. Subject: Cron <root@vps> test -x /usr/sbin/anacron ...
2
votes
2answers
217 views

script to rotate apache weblog

I am looking for a script that would rotate weblogs on apache. I'd like to schedule the script over cron so it could run periodically and rotate access_log and error_log for all websites on the ...
2
votes
2answers
782 views

Script to modify logrotate configuration files?

I'm looking for a script that will allow me to programatically modify logrotate configuration files. At the least I'd like it to be able to replace a block such as /var/log/wtmp { missingok ...
9
votes
5answers
8k views

Proper way to rotate Nginx logs

I would like to achieve rotation of nginx logs that: would work without any extra software (i.e. - best if without "logrotate") would create rotated files with names based on date Best approach is ...
8
votes
3answers
6k views

NginX Log Rotation

I am serving a couple different domains through NginX on the same server and they each log to their own file. I need to set up a script to rotate, and compress these files and add it to cron. I ...
1
vote
2answers
4k views

How to use wildcards within logrotate configuration files

I have the following configuration that is not working: 1) Using rsyslog with Centos 5. 2) Inside /etc/logrotate.d I have the file sj-piers-logs. SJ-PIERS-LOGS: /syslogrep/sjpiers-logs/0* { weekly ...
13
votes
3answers
3k views

Logrotate and Open Files

How does logrotate handle open files? Can logrotate rotate files that a process has open?
13
votes
8answers
4k views

Continuosly 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 ...
2
votes
3answers
1k views

Logrotate ERROR: No file found for /var/log/apache*/*error.log

Logrotate runs daily and emails me a report. This has been working fine however I now get the following email daily also: Date: Mon, 10 Aug 2009 04:02:08 +0100 From: root@localhost.localdomain (Cron ...
1
vote
2answers
335 views

Log Rotate and OpenVZ Virtual Machines

I noticed that my OpenVZ virtual machines (VEs) don't have logrotate installed, and my logs are getting a bit big :-) Since the file systems of the VEs are exposed to the host via /vz/private/.. , ...
10
votes
3answers
8k views
5
votes
3answers
5k views

logrotate rename files with date

Right now, logrotate renames old log files to access.log.1.gz, access.log.2.gz, etc. I would prefer if it named them access.log.20090714.gz, access.log.20090715.gz, etc - one for each day. I cannot ...
2
votes
1answer
3k views

Best practices for web server log archiving (Linux + Nginx)

I want to preserve/archive all of my web server logs, and not have any of them be deleted by logrotate. What would a recommended approach be for this? This is a Linux box, running Nginx. Thanks in ...
1
vote
3answers
2k views

Apache access log rotation

I think my system is using logrotate for rotating logs including httpd logs The "current" files is logged here /var/log/httpd/ but I only see the last 5 days(I think) But how can I find where ...
8
votes
4answers
4k views

Cronolog vs logrotate

Which log rotation tool do you prefer?