Questions tagged [logrotate]

A program for managing and archiving individual log files. It allows automatic rotation, compression, removal, and mailing of log files. Jobs can be configured to run hourly, daily, weekly, monthly, yearly or when reaching a certain size or age.

For details see the logrotate manpage.

96 questions
5
votes
1 answer

How can I configure logrotate to copy/SSH apache log files

I'm working on an apache logs analyser, it requires the apache log files to be imported into a directory for processing. I cannot simply point it to the apache logs directory as it imports each file before deleting it. It also has no concept of…
Stephen RC
  • 4,812
3
votes
1 answer

Logrotate: Using multiple criteria for rotating

How can I set a rotating policy based on a disjunction of size and frequency criteria. I have tried the following: "/var/log/uwsgi/*/*.log" { ... size 400M daily rotate 14 .. } However, even when logrotate is executed when the log file…
Adam Matan
  • 12,519
3
votes
1 answer

Logrotate: run every N hours

Consider a server which generates extensive logging, which are archived using logrotate and bz2: "/var/log/uwsgi/*/*.log" { copytruncate daily rotate 14 compress delaycompress missingok notifempty compresscmd /bin/bzip2 …
Adam Matan
  • 12,519
3
votes
1 answer

Ubuntu 22.04: Logrotate not working after upgrade to Ubuntu 22.04

I just realized that since the upgrade to 22.04.1, logrotate is not working. Syslog hasn't been rotated for many days. It's supposed to be run by systemd timers, and the related timer is activated: # systemctl list-timers NEXT …
ThinkHard
  • 303
2
votes
1 answer

How to rotate graphite's logs?

We have the graphite-web package installed, which came with its /etc/logrotate.d/graphite-web. Unfortunately, the "out-of-the-box" file is broken -- the files are rotated, but the daemons writing into them are never notified. Listing the files…
2
votes
1 answer

logrotate seems work incorrect

I'm using: Linux workdesk 3.16.0-31-generic #43~14.04.1-Ubuntu SMP Tue Mar 10 20:13:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS Release: 14.04 Codename: trusty logrotate 3.8.7-1ubuntu1…
Ilia
  • 21
1
vote
1 answer

What is the easiest way to setup Log rotation

Recently, I have setup a script that outputs to a single log file... After quite a while this file begins to become too large to manage. I was wondering what the easiest way is to setup log rotations for every few hundred lines located in the…
NerdOfCode
  • 2,498
0
votes
1 answer

rsyslog not write log after logrotate

OS: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-101-generic x86_64) rsyslog not writing logfile mail.log after logrotate, file mail.log is empty. After restart rsyslog (service rsyslog restart) mail.log starting write. config…
0
votes
2 answers

How does logrotate work?

I am trying to monitor a log file which rotates frequently by logrotate. but i am unable to get that correctly. can any one explain how actually logrotate works? Is a file renamed and a new file is created ? or is a file copied with a new name and…
0
votes
1 answer

Ubuntu stuck at startup after /var/log/ files caused "disk space" error

I started to work with pcie card on my Ubuntu pc. I have noticed that during operation, log files size at /var/log/ is increasing rapidly, especially syslog file (reached 36GB). it filled up with thousands lines of pcie read/write kernel…
0
votes
1 answer

what is the default value in logrotate.conf

In /etc/logrotate.conf is user permission different between Ubuntu 20.04 and 18.04 releases? #use the syslog group by default, since this is the owning group #of /var/log/syslog. su root syslog or #use the syslog group by default, since this is the…
0
votes
1 answer

Trouble getting logs to autorotate with logrotate

Ubuntu 20.04.2 LTS Gnome 3.36.8 $ logrotate --version logrotate 3.14.0 It's been impossible to get logs to rotate automatically once they reach a size of 125M. Here's the config file saved to /etc/logrotate.d: /home/App/Logs/*.log { missingok …
0
votes
1 answer

Does logrotate handle wildcards the same as ls?

I'd like to specify the files for logrotate to handle via the following wildcard string: /home/deploy/*/logs/nginx-*.log If I do ls with this wildcard string, it shows exactly the files I want to be rotated. Will logrotate handle the wildcard string…
Ghopper21
  • 103