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
37 views

How do I control rotation of the /var/log/[system-name] log directory (Ubuntu 20.04 LTS)

How do I control the logging that is sent to /var/log/[system-name]? On my host I have a directory within /var/log that matches my system name. In this case: /var/log/media-server. The directory is ...
user avatar
2 votes
0 answers
19 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, ...
user avatar
0 votes
1 answer
62 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 ...
user avatar
  • 103
0 votes
0 answers
28 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 ...
user avatar
0 votes
2 answers
82 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, ...
user avatar
1 vote
0 answers
102 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/...
user avatar
3 votes
1 answer
432 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 ...
user avatar
0 votes
1 answer
112 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 avatar
1 vote
1 answer
114 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 ...
user avatar
0 votes
0 answers
174 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/* { ...
user avatar
0 votes
2 answers
45 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 ...
user avatar
  • 1,928
1 vote
1 answer
473 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 ...
user avatar
  • 43
0 votes
1 answer
75 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/...
user avatar
1 vote
0 answers
731 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-...
user avatar
  • 11
0 votes
1 answer
93 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 ...
user avatar
0 votes
1 answer
166 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 348
3 votes
2 answers
5k 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/...
user avatar
1 vote
1 answer
3k 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 ...
user avatar
1 vote
1 answer
801 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 ...
user avatar
  • 171
2 votes
0 answers
596 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 ...
user avatar
0 votes
0 answers
330 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, ...
user avatar
  • 111
1 vote
0 answers
358 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 ...
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/...
user avatar
  • 29
1 vote
3 answers
310 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 ...
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 ...
user avatar
  • 11
5 votes
1 answer
7k 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/...
user avatar
  • 1,178
0 votes
0 answers
565 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 ...
user avatar
  • 7
1 vote
2 answers
6k 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 ...
user avatar
  • 211
4 votes
1 answer
5k 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 ...
user avatar
0 votes
1 answer
570 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 ...
user avatar
  • 103
0 votes
0 answers
73 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 ...
user avatar
  • 1
4 votes
2 answers
9k 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....
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 ...
user avatar
0 votes
1 answer
402 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: /...
user avatar
3 votes
1 answer
923 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)...
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 ...
user avatar
  • 2,218
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 ...
user avatar
1 vote
0 answers
688 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 ...
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 ...
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 ...
user avatar
  • 1,704
1 vote
1 answer
45 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 ...
user avatar
3 votes
1 answer
9k 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 ...
user avatar
  • 193
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....
user avatar
  • 819
5 votes
3 answers
2k 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 ...
user avatar
  • 1,704
0 votes
2 answers
775 views

How to add custom logrotate configuration files to Ubuntu core?

Is there a way to add custom logrotate configuration files to Ubuntu core? /etc/logrotate.d is not writable. Should /writable/system-data/etc/logrotate.d be sourced? It doesn't seem to work and also ...
user avatar
0 votes
2 answers
4k views

Logrotate is deleting my logs

I have this logrotate config which is not in /etc/logrotate.d /path/to/my/logfile.log { su root root daily maxage 365000 copytruncate dateext dateformat -%d.%m.%Y } I run it ...
user avatar
0 votes
0 answers
812 views

How do I use logrotate to remove old log tarballs?

I'm using Ubuntu 14.04. I want to rotate log files daily, including deleting old tarballs. I edited my logrotate.conf file, /etc/logrotate.conf, like so /home/rails/myproject/log { daily ...
user avatar
  • 1,704
0 votes
0 answers
3k views

Why logrotate is not running automatically in ubuntu 16.04?

I am on ubuntu 16.04 but from recent time I have seen complaints of very low system space. I tried to find and found that it was due to old log files so I find that the old files can be rotated as by ...
user avatar
  • 173
1 vote
1 answer
341 views

Best ways to manipulate system logs

I want to manipulate logs. So far, for me the best way to clear system logs is: truncate -s 0 /var/log/*log I'm searching for the best ways to: 1 - Do the above periodically. I have already try ...
user avatar
  • 1,081