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
7
votes
3 answers

logrotate: log does not need rotating

logrotate is not rotating my logs To verify that the logfile is not empty: # ls -laFh /var/log/cisco-meraki.log -rw-r----- 1 root adm 2.8G Sep 5 13:23 /var/log/cisco-meraki.log Configuration…
Idar Lund
  • 71
  • 1
  • 1
  • 3
6
votes
3 answers

logrotate entire directory containing log files

Is there a way using logrotate I can rotate entire directory and compress it instead of just the files in a particular directory? I tried experimenting using the config below but that does not work. Give the error message…
iDev
  • 2,163
  • 10
  • 39
  • 64
6
votes
2 answers

possible to logrotate rails app with nginx passenger without restart?

It is possible to do logrotate without restarting nginx (just send USR1 signal to nginx it will do the job). I wonder it is possible for my rails app (nginx passenger). It's not worth to restart my rails apps just to do a logrotate.
Chamnap
  • 4,666
  • 2
  • 34
  • 46
6
votes
1 answer

How to Configure logrotate of php5-fpm.log?

I enabled the error_log = /var/log/php5-fpm.log under /etc/php5/fpm/php-fpm.conf on my ubuntu 12.04 running nginx and php5-fpm. But I noticed that php5-fpm.log does not logrotate. I tried to understand some of the configuration I found from the…
jaypabs
  • 1,519
  • 10
  • 43
  • 62
6
votes
1 answer

Filename glob options with logrotate

I want to configure logrotate to handle /var/log/apache2/access.log separately from all other log files written to /var/log/apache2. Without specifying all the other logs by name explicitly, is there a way to get this to work? I've read online that…
Rob Crowell
  • 1,447
  • 3
  • 15
  • 25
6
votes
1 answer

Logrotate - String of junk at top of log files

I've recently set up the following logrotate job: /var/log/app.*.log { daily rotate 7 copytruncate nocompress dateext } I've found that when I go to view my log files, they start with some binary junk. I have to grep using…
whats canasta
  • 763
  • 2
  • 7
  • 16
6
votes
1 answer

How i configure logrotate to not delete my log files after rotation?

There's a way to do this?
Guilherme
  • 1,126
  • 9
  • 17
5
votes
2 answers

Enable log rotation in rsyslog

How to enable log rotation in rsyslog configuration. The method described in the official documentation of rsyslog using output channels is not working for me. The script given in the official documentation of rsyslog for output channel is available…
Kumar Rounak
  • 49
  • 1
  • 5
5
votes
2 answers

rotate pod logs on kubernetes by time

My team has a special requirement to delete all pod logs every X hours. This is cause the logs contain some sensitive info - we read and process them with fluentbit, but it's an issue that the logs are still there after. I couldn't find any normal…
J. Doe
  • 161
  • 2
  • 2
  • 5
5
votes
1 answer

logrotate says permission denied when rotating log / re-creating log file

I'm new to logrotate on linux machines... here's what I have set up in my app's logrotate.d file: /var/log/myapp.log { daily missingok create 0660 root utmp rotate 1 } I set owner permissions on the myapp.log file for the account that runs the app…
Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
5
votes
1 answer

error: Ignoring /etc/logrotate.conf because it is writable by group or others

error: Ignoring /etc/logrotate.conf because it is writable by group or others I got this error from my crontab log 4 -rw-r--r-- 1 root root 520 Mar 27 12:15 logrotate.conf I am given 644 for logrotate.conf, how can I solve this…
Pradeep Chandran
  • 327
  • 5
  • 11
5
votes
3 answers

How can I get log rotation working inside a kubernetes container/pod?

Our setup: We are using kubernetes in GCP. We have pods that write logs to a shared volume, with a sidecar container that sucks up our logs for our logging system. We cannot just use stdout instead for this process. Some of these pods are long lived…
Tyler Zale
  • 634
  • 1
  • 7
  • 23
5
votes
1 answer

AWS Elastic Beanstalk Log Rotation

I'm running a java application on AWS Elastic Beanstalk (Java 8 running on 64bit Amazon Linux/2.7.4) By default the java application logs to STDOUT and Elastic Beanstalk automatically stores STDOUT in /var/log/web-1.log. This works as expected. See…
5
votes
2 answers

How to exclude ".gz" files in logrotate

I am using logrotate version 3.12.3. How do I tell logrotate to exclude files that are already rotated/compressed? For example, if I am rotating all files in /var/log as "/var/log/*" { compress missingok dateext rotate 4 …
user3282227
  • 131
  • 2
  • 10
5
votes
0 answers

log rotation inter-process lock failed opswork clockwork

I am using opswork with t2.medium machine with ruby clockwork running in it. every 30 seconds we are triggering a job. SPAWNED BG JOB FOR TASK: 20 for SC: 20 with Sidekiq id: 3afda705eaf597edb4bcc257 log rotation inter-process lock failed. No such…
shakeel
  • 801
  • 1
  • 8
  • 24