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

How do i ensure that tail would read file even it's rotated?

I'm trying to implement nginx log rotation with sending all logs to Apache Kafka pubsub messaging. While having a quite large input (about 1GBpm) i'm not sure how tail would behave when log file is rotated. For example: I'm tailing log file with…
Gening D.
  • 303
  • 6
  • 14
0
votes
0 answers

How do I configure logrotate for a file in Ubuntu to rotate it as soon as it's size reaches 1KB?

I see an option in logrotate.conf which can specify a size for a file for rotation. However it seems like it runs the cron job (hourly/weekly etc.) and only if the size is greater than the threshold specified in the conf file, does it rotate the…
shrinidhisondur
  • 771
  • 1
  • 8
  • 18
0
votes
1 answer

how to rotate log files by filesize?

ATTENTION: there are many articles about rotating log files by date/time. But i want to rotate log files by filesize. Is it possible? i have apache access_log file which is growing largely and taking up the entire server free space after 2/3 weeks.…
Rakib
  • 12,376
  • 16
  • 77
  • 113
0
votes
2 answers

out.log file and error.log file size exceed

The following line which include into the cronjob. 18,36,54 * * * * /usr/bin/perl /home/folder.my_perl.pl >> out.log 2>> error.log The error.log file will write all the errors and out.log file write all the output statement. I want to know that,…
Pranay
  • 5
  • 6
0
votes
2 answers

MongoDB logrotate config

I am using MongoDB 1.6.4. The script I used is: /usr/local/test/r0/log/mongo.log { daily rotate 10 nocompress dateext missingok notifempty sharedscripts copytruncate postrotate /bin/kill -SIGUSR1 `cat…
fmchan
  • 760
  • 1
  • 11
  • 29
0
votes
1 answer

optimal way to monitor file size using java

I would like to rotate logs that are already being managed by logrotate. However logrotate used to rotate log only on daily basis as it is purely a CRON task. I would like to execute logrotate when ever the file size exceeds the size specified in…
Balachandar
  • 1,538
  • 3
  • 16
  • 25
0
votes
1 answer

logrotate not rotating logs based on size

I am using logrotate to rotate the test.log log files available in the directory /var/test/log. Below is the snippet of logrotate configuration file DO NOT MODIFY THIS FILE. /var/test/log/test.log { daily nocompress copytruncate missingok rotate 10…
Balachandar
  • 1,538
  • 3
  • 16
  • 25
0
votes
0 answers

How to pass parameters to logrotate file?

I am new to Linux env. I got task that how to pass parameters to logrotate configuration file. E.x Size <> instead of static configuration like Size 3. Either passing param values to logrotate OR reading from config also fine.
Subbu
  • 308
  • 2
  • 4
  • 12
0
votes
1 answer

cron.hourly is not working

I have scheduled the cron.hourly job for rotating the catalina.out log. I have created a file called tomcat in logrotate.d with below content /opt/apache-tomcat-7.0.55/logs/catalina.out { copytruncate daily size 500k rotate 3 …
Krishna
  • 179
  • 3
  • 17
0
votes
0 answers

How do I stop recurring error messages from appearing in messages and auditd.log?

On my CentOS linux machine, in my auditd.conf file, I have set my max_log_file_action=keep_logs. However, in my /var/log/messages and /var/log/auditd.log, the following message appears multiple times a second which is filling up those log files…
adeena
  • 4,027
  • 15
  • 40
  • 52
0
votes
1 answer

Logrotate does not upload to S3

I've spent some hours trying to figure out why logrotate won't successfully upload my logs to S3, so I'm posting my setup here. Here's the thing--logrotate uploads the log file correctly to s3 when I force it like this: sudo logrotate -f…
worker1138
  • 2,071
  • 5
  • 29
  • 36
0
votes
0 answers

Logrotate seemingly freeing system memory

We have a bit of a mystery on our hands. We are seeing what appears to be a memory leak in one of our Erlang systems. System memory utilization slowly, but steadily, increases over time. Then, when our logrotate job for that apps system logs runs we…
RockyMountainHigh
  • 2,871
  • 5
  • 34
  • 68
0
votes
1 answer

Save multiple folders with logrotate

I am trying to save my folders (except some) in /var/www with logrotate daily, weekly and monthly. I try, in the postrotate, to do something like cd /var/www/ for i in $(ls -d */); do echo ${i%%/}; done | \ grep -Ev…
0
votes
1 answer

Logrotate every 30th second and store logfiles in date-named directories

I've got a CentOS installation with a busy webserver. I need to aquire stats from the log files and keep the old ones, ordered by date. Every 30th second, the current logfile should be closed and processed (analysing entries and storing them into a…
Anders
  • 251
  • 3
  • 13
0
votes
1 answer

Why logrotate did nothing but complained no errors?

The answer maybe obvious to you, but I am beginning to run my first logrotate instance. The configuration in /etc/logrotate.d /mnt/nginx/logs/access.log { size 1k dateext missingok rotate 10 compress …
james
  • 31
  • 1
  • 4