Questions tagged [logrotate]

A Linux tool for log files management. Do not use this tag for general questions about usage of logrotate and troubleshooting, but for programming questions related to logrotate.

Quoting the man page:

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.

469 questions
657
votes
8 answers

Is it possible to run one logrotate check manually?

Is it possible to run one iteration of logrotate manually without scheduling it on some interval?
Vladimir
  • 12,753
  • 19
  • 62
  • 77
90
votes
3 answers

Centos/Linux setting logrotate to maximum file size for all logs

we use logrotate and it runs daily ... now we have had some situations where logs have grown significantly (read: gigbaytes) and killing our server. So now we would like to set a maximum filesize to the logs .... can I just add this to the…
snh_nl
  • 2,877
  • 6
  • 32
  • 62
78
votes
2 answers

Hourly rotation of files using logrotate?

I tried to set up a log rotation of logs files located at /tmp/hr_logs/. For setting up, I used logrotate in linux and I'm able to rotate it on daily basis using the following config in my /etc/logrotate.conf /tmp/hr_logs { daily rotate…
Kishore
  • 901
  • 1
  • 6
  • 4
46
votes
5 answers

Apache and logrotate configuration

Last week I found a problem on my server, because the disk usage was 100%, and I found out apache had created a huge error.log file of 60GB. I changed then the LogLevel to emerg, but after one week, it is again 1.3GB which is definitely too…
sissy
  • 2,908
  • 2
  • 28
  • 54
39
votes
11 answers

Logrotate files with date in the file name

I am trying to configure logrotate in RHEL for tomcat6 logs. Currently, logrotate works fine for catalina.out log, it is rotated and compressed properly. The problem is with the files with date in them…
Noman Amir
  • 933
  • 3
  • 15
  • 30
37
votes
6 answers

Logrotate to clean up date stamped files

I'm currently trying to work out a method of tidying up Oracle Recover log files that are created by Cron... Currently, our Oracle standby recover process is invoked by Cron every 15mins using the following command: 0,15,30,45 * * * *…
fatmcgav
  • 431
  • 1
  • 4
  • 8
35
votes
2 answers

How to insert a date inside the filename with logrotate

I need to set logrotate to rotate logs files from an application running on the server. I need the date inside the filename. I set dateext and also dateformat to add a - in the date. The result filename is:whatever.csv_2012-03-03 I would like the…
Bernard Sfez
  • 1,329
  • 2
  • 15
  • 18
33
votes
4 answers

How to perform log rotation with Gunicorn?

I searched through the net but didn't get the concrete answer or example of "how to use log rotation with Gunicorn?". It would be great if someone provide an example.
neel
  • 8,399
  • 7
  • 36
  • 50
31
votes
3 answers

Logrotate - nginx logs not rotating inside docker container

I've a docker container running nginx which is writing logs to /var/log/nginx Logrotate is installed in the docker container and the logrotate config file for nginx is set up correctly. Still, the logs are not being automatically rotated by…
dazito
  • 7,740
  • 15
  • 75
  • 117
30
votes
2 answers

ProFTPD killed (signal 15) error - how to fix logrotate restart error?

ProFTPD on Ubuntu is being killed unexpectedly. Log message: $ tail /var/log/proftpd/proftpd.log.1 ... ... ProFTPD killed (signal 15) ... ProFTPD 1.3.5rc3 standalone mode SHUTDOWN Diagnosis: the time of the message is the same time that cron runs…
joelparkerhenderson
  • 34,808
  • 19
  • 98
  • 119
22
votes
3 answers

error: error creating state file /var/lib/logrotate/status: Permission denied

Trying to use logrotate and I get the following error when I run the log rotate script for a particular definition in logrotate.d error: error creating state file /var/lib/logrotate/status: Permission denied /var/lib/logrotate$ ls -lah total…
Victor S
  • 5,098
  • 5
  • 44
  • 62
21
votes
2 answers

How can I fix "/etc/cron.daily/logrotate: gzip: stdin: file size changed while zipping"?

in last days i get daily mail from cron's logrotate task: /etc/cron.daily/logrotate: gzip: stdin: file size changed while zipping How can I fix it? Thanks, Gian Marco.
Kiuki
  • 624
  • 3
  • 7
  • 16
19
votes
1 answer

App writes to ".log.1" file instead of ".log" file after running logrotate

After force running logrotate, my app keeps writing to my_app.log.1 (the old log that should be archived later) instead of my_app.log. This make my_app.log an empty file, therefore logrotate runs without any effect. And my_app.log.1 keep growing to…
Tung Nguyen
  • 1,874
  • 3
  • 18
  • 28
18
votes
4 answers

logrotate compress files after the postrotate script

I have an application generating a really heavy big log file every days (~800MB a day), thus I need to compress them but since the compression takes time, I want that logrotate compress the file after reloading/sending HUP signal to the…
Thomas BDX
  • 2,632
  • 2
  • 27
  • 31
17
votes
2 answers

Redis logrotate config

Does anyone have a sample logrotate config for redis? This is what I have so far /var/log/redis/*.log { daily missingok rotate 52 compress delaycompress notifempty create 640 root adm …
Simian
  • 1,622
  • 3
  • 17
  • 32
1
2 3
31 32