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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Using logrotate with rsyslog for rotation of logs based on fixed size

Due to specific requirements, there is a need to constrict syslog to a particular size (512 MB) and also to move the syslog and kern.log to a separate custom location. Current Syslog configuration - $...
shaggy's user avatar
  • 35
0 votes
0 answers
31 views

Is there a way to run logrotate of a specific application's logs only at times other than midnight?

I put the file I set in the "logrotate.d folder". And I wanted to run the file only at 00:30 every day through "crontab -e". However, when I checked the next day, it was executed ...
john_smith's user avatar
1 vote
1 answer
41 views

Logrotation has different behaviors when reading from "/etc/logrotate.conf" and "/etc/logrotate.d/*conf" files

We need to keep only one log file of each service in our Ubuntu 20.04 servers. I've modified the /etc/logrotate.conf file as follows: weekly su root adm rotate 0 create ifempty include /etc/logrotate....
O_Ofsk24's user avatar
1 vote
0 answers
33 views

logrotate not removing old files

I'm trying to create a logrotate configuration that is the same for all log files. Right now I have /var/log/* { size 100k rotate 5 missingok compress } I created a shell script that ...
Adam's user avatar
  • 11
0 votes
0 answers
18 views

How can I schedule daily logrotate for a different time of day [duplicate]

The only information I can find indicates logrotate happens at midnight. That happens to be UTC on my server and 10AM local time. How can I reschedule logrotate to a more convenient time when fewer ...
Mike Dewhirst's user avatar
3 votes
1 answer
2k views

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: # ...
ThinkHard's user avatar
  • 303
2 votes
0 answers
223 views

Each day when the logs turn over, the system fails to find space even though there is plenty on the device; potential error with init.d script

I'm still at a loss for this specific error and any help or pushing in the right direction would be much, much appreciated. TL;DR: Many, many instances of an init.d spawned script seem to be running, ...
user3684314's user avatar
1 vote
1 answer
417 views

What are the options to manage the size of /var/log/syslog of an embedded system

I have an embedded system (i.MX6) running a modified version of Ubuntu 18.04 LTS bionic stored on its SD card and I want to know how to manage /var/log/syslog file size. I noticed that systemd journal ...
Aminos's user avatar
  • 133
0 votes
0 answers
208 views

large number of strange samba log files not cleaned by logrotate

On my ubuntu 20.04.2 LTS I see a large number of log files with names like this: log.2003_df_272d_9b00_810b_3c34_b13a_800c log.2003_df_272d_9b00_30b7_2646_c9ca_36c9 These are obviously created by ...
user333869's user avatar
-1 votes
2 answers
307 views

Bash script for Logrotate can't start in crontab

i have a simple bash script for execute a logrotate command which is the follow command: sudo logrotate -f /etc/logrotate.d/logfile When i set the bash script into crontab the script didn't execute, ...
rikorey's user avatar
1 vote
0 answers
463 views

Logrotate syslog and mysql error

OS version: 20.04 When trying to manually logrotate, there are errors rotating syslog and mysql. ~$ sudo logrotate -f /etc/logrotate.conf error: rsyslog:4 unknown unit 'e' error: found error in /var/...
TurboSlayer's user avatar
3 votes
1 answer
1k views

Ubuntu 20.04.3: nginx crashes with segfault

I have an Ubuntu box (20.04.3) on which nginx stopped already twice with a segfault: Nov 16 00:01:23 documents-oo kernel: [2726316.050697] nginx[2579242]: segfault at 41 ip 00007fbf59548593 sp ...
Bernd Lentes's user avatar
0 votes
1 answer
270 views

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 #...
User.. 's user avatar
0 votes
1 answer
605 views

log rotation for /var/log

I got an alert that the root directory is running out of space. On inspection using ncdu i found that the /var/log folder was taking alot space. Then further inspection shows that syslog and kern.log ...
Andrew Mititi's user avatar
0 votes
0 answers
328 views

The size of log files is still big after logrotate on ubuntu 20.04

logrotate was setup on Ubuntu 20.04 to limit the besu log file size to 10MB, keep 4 weeks log with rotating weekly and delete the old log file. Here is the besu conf: #for besu log /home/log/besu/* { ...
user938363's user avatar
0 votes
2 answers
54 views

How do I get the latest logrotate, which isn't yet in the apt repositories?

I'm on 20.04, which has logrotate 3.14.0. I need a later version which has important bugfixes. This page shows that 20.04 has version 3.14.0, and this page shows that 21.04 has version 3.18.0 (the one ...
lonix's user avatar
  • 2,308
1 vote
1 answer
844 views

Mysql logrotation doesn't work

I'm having trouble making Mysql log rotation working. I don't know why this is so complicated , even though I followed documentation and internet advice, still cannot make it work. I have enabled all ...
AlexP's user avatar
  • 83
0 votes
1 answer
118 views

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/...
Maxximiliann's user avatar
2 votes
2 answers
2k views

Setting a size limit for current syslog

Based on other threads, the only way to set a size limit on current syslog (/var/log/syslog) seems to be via rsyslog which is a bit tricky. I ended up replacing the line below in /etc/rsyslog.d/50-...
Nerssi's user avatar
  • 21
0 votes
1 answer
137 views

Syslog start logging in the morning! why?

Hello I've a Ubuntu server 18.04 running. But the problem is syslog start logging at every morning not at 00:00 midnight! Jan 5 06:25:03 localhost snmpd[810]: truncating integer value > 32 bits ...
Sakib Mahmud's user avatar
0 votes
1 answer
262 views

Why My Logrotate Configurations Doesn't Work Correctly for MySQL-MariaDB?

I am using an MariaDB Galera 3-Cluster and I saw that the mysql logs on Node 2 grows up to 100gb and I decided to limited these logs that will not grow a lot. I used logrotate for that, so an file ...
Nutabella's user avatar
1 vote
1 answer
3k views

/var/log/syslog not getting rotated

I have a fresh install of ubuntu 20.04. I have set daily rotation in /etc/logrotate.d/rsyslog file with a maxsize of 1M but the /var/log/syslog and kern.log file keeps increasing. Here is the rsyslog ...
AjayC's user avatar
  • 400
4 votes
2 answers
8k views

logrotate succeeds when manually run as root, but fails with "Read-only file system" when run by logrotate.service

I have a (formerly working) logrotate setup for OpenResty that I took from a previous Ubuntu 18.04 installation. Yet the logrotate.service fails with this error now ... error: error renaming /usr/...
Philipp Claßen's user avatar
2 votes
1 answer
5k views

logrotate - file owner issue

I want to rotate the syslog for testing. sudo logrotate -f /var/log/syslog [sudo] password for stephen: error: Ignoring /var/log/syslog because the file owner is wrong (should be root or user with ...
Stephen Boston's user avatar
1 vote
1 answer
1k views

Cannot run logrotate utility automatically from cron

I run sudo crontab -e and append the following line: * * * * * logrotate -f /etc/logrotate.d/adraw; touch /ADraw/Data/Logs/test.txt The file test.txt is successfully created, but I see no results of ...
Apogentus's user avatar
  • 181
2 votes
0 answers
640 views

Logrotate not doing his job, hdd full because of logs

I have a small microSD ( 3GB ) on a ARM Samsung Artik, with Ubuntu installed. I have installed syslog-ng and Logrotate to manage my logs, because otherwise my memory get filled quickly. My problem ...
Juliatzin del Toro's user avatar
0 votes
0 answers
403 views

Logrotate doesn't work in read only mode

I am running a device in read only mode with ubuntu and also I need to run Mysql server. Mysql server creates error log files in /var/log/mysql directory. But since I am running it in read only mode, ...
LIH's user avatar
  • 111
1 vote
0 answers
475 views

syslog-ng leaving empty log files after rotation

Let me start by saying I am new to syslog-ng and logrotation and am doing this at home to learn. I have log files that are being sent to my syslog server from my router and are logging no problem ...
MyUbuntuUser7000's user avatar
1 vote
1 answer
2k views

How to enable a logrotation with Jenkins

I need to enable the logrotate service with Jenkins in order to rotate its log files (/var/log/jenkins/jenkins.log). So, I configured a script in /etc/logrotate.d with right permissions: /var/log/...
roghan's user avatar
  • 29
1 vote
3 answers
438 views

Logrotate on "not always on" system

I have several Ubuntu 16.04 and 18.04 systems, whose have no defined operating hours, for example desktop, laptop or VMs runt on demand. What are the right ways and tools to automatically rotate logs ...
Koguni's user avatar
  • 51
1 vote
2 answers
4k views

Ubuntu 18.10 Tomcat8 catalina.out file path

In previosu version, I saw that the catalina.out file was created at /var/log/tomcat8/catalina.out location. As I was study for my current installation, Ubuntu 18.10 and last package version, I saw ...
Etienne's user avatar
  • 11
5 votes
1 answer
9k views

How to set size for system log

My server dumps because of huge system log files. I've heard that we could limit the size of system log by adding such a line size 100m into the file /etc/logrotate.d/rsyslog to do so. Now my /etc/...
Yves's user avatar
  • 1,238
0 votes
0 answers
809 views

Mysql bin.log file rotation

I am trying to change the binary log rotation from days to hours. By default there is an option only for days in mysql config file: expire_logs_days. Is there any way, where i could change binary log ...
Rehan's user avatar
  • 7
1 vote
2 answers
7k views

Where should I look for logrotate config file of /var/log/mail.log

I would like to change the suffix of mail.log rotated files to include the date, such as /var/log/mail.log.20180920 I read from this question that /etc/cron.weekly/sysklogd should be changed, but I ...
Alex's user avatar
  • 211
6 votes
1 answer
7k views

What is the syntax for commenting out lines in logrotate config files?

Not sure if this is possible at all. And what about empty lines? Update: Testing the config with logrotate -d /etc/logrotate.d/apache2 returns error: /etc/logrotate.d/apache2:1 lines must begin ...
Reto Höhener's user avatar
0 votes
1 answer
656 views

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 ...
Ghopper21's user avatar
  • 103
0 votes
0 answers
82 views

logrotate is unable to list the created files in linux

i created my logrotate in /etc/logrotate.d/rsyslog /var/log/pcapcapture/capture.log { maxsize 100k minsize 100k hourly ...
bhavya's user avatar
  • 1
4 votes
2 answers
10k views

Logrotate configuration: it works, but always keeps 'current' log empty

I moved logging for openvpn into its own log and attempted to set up log rotation for it, but I've obviously done something wrong. Logging occurs as desired but always into the 2nd logfileopenvpn.log....
Organic Marble's user avatar
1 vote
0 answers
1k views

Daily compress log files not working

This is the log file I am using to compress log files on a daily basis. /home/ubuntu/logs/server.log { daily missingok rotate 1 compress create dateext dateyesterday ...
cogitoergosum's user avatar
0 votes
1 answer
440 views

logrotate weekly archiving empties out daily files

My aim is to maintain 4 days' worth of log files so that on the fifth day, a zip file with all four log files is created. The four log files created so far are deleted. This is my logrotate.conf: /...
cogitoergosum's user avatar
2 votes
1 answer
967 views

How to configure logrotate in a default, most basic conf for an all-default system?

I have an all-default Ubuntu VPS machine with Nginx, for a few light WordPress sites with say up to 5 plugins, 10 webpages, 20 images each. So far I cleaned all default logs (or at least some of them)...
Arcticooling's user avatar
1 vote
1 answer
2k views

What is the easiest way to setup Log rotation [duplicate]

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 ...
NerdOfCode's user avatar
  • 2,408
0 votes
1 answer
1k views

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 ...
user770387's user avatar
1 vote
0 answers
840 views

Log rotation is not working automatically

Trying to create log rotation, but it's not working automatically. write following code in .sh file and store in /etc/logratate.d/xxx: /var/log/xxx/*.log { daily missingok rotate 10 compress ...
Jason's user avatar
  • 11
2 votes
1 answer
1k views

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 ...
Mikhail T.'s user avatar
0 votes
2 answers
1k views

How do I rotate my logs despite having running processes?

I'm running Ubuntu 14.04. I have this Rails project and my logs are exploding out of control size-wise ... myuser@myapp:~$ ls -al /home/rails/myapp/log/ total 3118220 drwxr-xr-x 2 rails rails ...
Dave's user avatar
  • 2,014
1 vote
1 answer
47 views

logrotate does not produce any output

I set up a logrotate configuration file containing containing two entries. the file contains the following: /var/www/designer-24.com/var/log/* { daily missingok rotate 7 dateext ...
Nicolas El Khoury's user avatar
3 votes
1 answer
10k views

How to rotate a log file in ubuntu on size basis hourly?

/opt/variable/log/myapp.log { rotate 24 hourly maxsize 10k compress ifempty postrotate reload rsyslog > /dev/null 2> & 1 || true endscript } I have copied ...
ams's user avatar
  • 203
3 votes
1 answer
12k views

How can I configure logrotate without having `/etc/logrotate.d/rsyslog`?

I am trying to configure log rotation on my Ubuntu machine so that logs are rotated every day and kept for 14 days. Most tutorials I find, such as this one, mention that I should modify /etc/logrotate....
Aras's user avatar
  • 819
5 votes
3 answers
3k views

Why do only some of my logs get rotated?

I'm using Ubuntu 14.04. I have the following in my /etc/logrotate.conf file ... /home/rails/myproject/log { daily rotate 3 compress delaycompress missingok ...
Dave's user avatar
  • 2,014