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
0
votes
1 answer

Why logrotate makes an extra rotation?

Trying to configure logrotate for 10 daily rotation in my dump folder I have 11 rotations (mydump.sql, mydump.sql.1 ... mydump.sql.11), why? This is my logrotate configuration file in /etc/logrotate.d/ (I'm running Ubuntu server 12.4 LTS with…
Alepac
  • 101
  • 4
0
votes
1 answer

Rotating a nohup.out logfile

There are a few questions on how to rotate the output file generated by nohup. Most of the answers say to use logrotate with the copytruncate option. However this does not actually work -- when the rotation occurs, it creates the rotated logfiles…
Miral
  • 169
  • 1
  • 7
0
votes
1 answer

logrotate output to /dev/null twice?

So I was checking my logrotate config for httpd, and, in the section postrotate ... endscript it has the following: /sbin/service httpd reload > /dev/null 2>/dev/null || true I understand the first one, if there is output, send it to /dev/null, but…
fizzy drink
  • 385
  • 4
  • 8
  • 22
0
votes
1 answer

How to rotate log files when running pyapns and twistd

I use pyapns (Iphone push server) which in turn uses twisted (twistd daemon). twistd daemon produces twistd.log files. It rotates them to twistd.log.1, twistd.log.2 and so on when twistd.log reaches 1MB but it doesn't use logrotate so I guess it's…
Henrik
  • 131
  • 1
  • 5
0
votes
3 answers

Configuring Logrotate for Fluentd files. Necessary?

I have the following fluent.conf type forward type monitor_agent port 24220 # Listen DRb for debug type debug_agent port 24230 type tail path…
james_womack
  • 113
  • 1
  • 5
0
votes
1 answer

PDNS log rotation

I wonder what's the recommended way to rotate PowerDNS log files. I added the following entry to logrotate: # cat /etc/logrotate.d/pdns /var/log/pdns/*.log { daily rotate 7 compress delaycompress } - but it looks like PowerDNS…
HTF
  • 3,148
  • 14
  • 52
  • 82
0
votes
1 answer

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 man page which can do that.
user219962
0
votes
1 answer

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 logs file grows by 10 mb all my vps space goes…
0
votes
0 answers

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 apache to it, similar to how rotatelog operates.…
0
votes
1 answer

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 /usr/bin/killall -HUP syslogd endscript …
0
votes
1 answer

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?
Mingyu
  • 115
  • 7
0
votes
1 answer

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: ~# logrotate -f /etc/logrotate.d/squid3 error:…
Diamond
  • 9,001
  • 3
  • 24
  • 38
0
votes
1 answer

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 that I'm copying a log file (which can be large) to…
hookenz
  • 14,472
  • 23
  • 88
  • 143
0
votes
1 answer

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 file name of the old log, while only keeping logs…
Demented
  • 3
  • 1
0
votes
1 answer

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 tarun@example.com missingok rotate…
Tarun
  • 127
  • 1
  • 7