Questions tagged [logrotate]

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.

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.

Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the criterium for that log is based on the log’s size and logrotate is being run multiple times each day, or unless the -f or -force option is used.

Any number of config files may be given on the command line. Later con- fig files may override the options given in earlier files, so the order in which the logrotate config files are listed in is important. Nor- mally, a single config file which includes any other config files which are needed should be used. See below for more information on how to use the include directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file.

If no command line arguments are given, logrotate will print version and copyright information, along with a short usage summary. If any errors occur while rotating logs, logrotate will exit with non-zero status.

AUTHORS

   Erik Troan 
   Preston Brown 
436 questions
2
votes
4 answers

How important is it to keep size of log files down?

I have a LAMP server where logrotate does its job once per week, and I notice some logs tend to get quite large. For example, the apache access-log is 73MB. Is it better that I tell logrotate to rotate it daily? Does size matter for the performance…
2
votes
2 answers

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 are pretty big files so should only be kept for 1…
James
  • 143
  • 1
  • 7
2
votes
1 answer

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 5 mag 18:38 access.log -rw-r----- 1 root adm …
ELAN42
  • 21
  • 1
2
votes
1 answer

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? my config file is like…
Igor
  • 21
  • 2
2
votes
1 answer

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 advance. (I would prefer to use cronolog, but it…
user11480
2
votes
2 answers

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 any convenient tools/utilities that will (a)…
Trent Scott
  • 959
  • 1
  • 12
  • 28
2
votes
1 answer

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 the last 7 days of log and errors.log.1.gz compressed…
Ant
  • 193
  • 1
  • 9
2
votes
1 answer

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 /var/run/varnishncsa.pid 2>/dev/null` 2> /dev/null…
nixnotwin
  • 1,543
  • 5
  • 35
  • 55
2
votes
1 answer

How do I tell logrotate what files to rotate with cron?

On my webserver I have this file: /etc/logrotate.d/apache2 I know it is logrotating /var/log/apache2/.log, but if I want to add things that are in /usr/home/www/site1/logs/.log do I just duplicate everything below and stick that line in there? Each…
cwd
  • 2,763
  • 9
  • 33
  • 48
2
votes
1 answer

Reason to use rsyslog for log rotating?

Is there any benefit to using rsyslog's rotation abilities over the standard /sbin/logrotate?
mikewaters
  • 1,175
  • 1
  • 14
  • 27
2
votes
2 answers

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 no logging is missing and dateext will overwrite…
Thirler
  • 156
  • 1
  • 5
2
votes
2 answers

Logrotate configuration for httpd (CentOS)

I'm running Apache 2.2.3 on CentOS 5.5 and just noticed the following logrotate postrotate configuration in /etc/logrotate.d/httpd: postrotate /sbin/service httpd reload > /dev/null 2>/dev/null || true endscript Since this is set to run once per…
Ralph
  • 105
  • 1
  • 6
2
votes
2 answers

Any good reason not to use date-based logfile rotation (rdiff-backup)?

rdiff-backup is a really nice tool for backing up Linux servers. One problem, though, is logrotation: Since rdiff-backup doesn't know how to detect renamed files, every daily backup contain a complete copy of all rotate log files. A possible fix…
flight
  • 394
  • 4
  • 14
2
votes
1 answer

Log file - 1.6 GB - how to push rotation of log file

How do I push the rotation of a log file.... other_vhosts_access.log is 1.6 GB right now.... the odd thing is that the date on the file is for today, the last rotated file is from 12-12 (a week ago) and is 816 MB...
Ben
  • 3,800
  • 18
  • 65
  • 96
2
votes
1 answer

Specific names after logrotate

I'd like logrotate to create files which have nice names. Is there some way to force some pattern for the names after rotation? I'd like to create a service-{year}-{month}-{day}-{hour} format and rotate hourly. It seems I'm running a version with…
viraptor
  • 1,296
  • 6
  • 21
  • 41