Questions tagged [logrotate]

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.

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

Time-based rotation of Docker logs

We are running a stack of Docker Swarm services and, according to our Privacy Policy, we have to keep logs only for the last 6 months, but no older. I was trying to achieve it through different ...
0
votes
0answers
72 views

logrotate codeigniter logs, keep 7 days only

I'm trying to rotate logs produced by CodeIgniter, they are named this way (one per day) log-2020-05-05.php log-2020-05-06.php log-2020-05-07.php The idea is to package this in a debian package for ...
0
votes
0answers
14 views

Logrotate says it is going to delete logs, but they are still present

I have a logrotate set up, and when run with logrotate -d /etc/logrotate.conf, it says it is going to delete logs. However, they are still there when I check: rotating pattern: /var/log/httpd/*log ...
0
votes
1answer
25 views

Logrotate- restart service only if it was running

I have HA cluster with samba running on the active node, now i get these error's in my root mail: Can't find pid for destination 'smbd' error: error running non-shared postrotate script for /var/log/...
0
votes
0answers
17 views

Signal dockerized php-fpm to reopen its logs

When using logrotate with php-fpm, we can signal it to reload its logs: postrotate kill -USR1 "$pid" endscript But when php-fpm is inside a docker container, which has a number of processes, how ...
0
votes
1answer
29 views

Logrotate docker container's logs when user doesn't exist on host

I mounted my containers' logs to the host (e.g. /var/log/container1, etc). Now I want to use the host's logrotate. But suppose I need to do this: create 660 mysql mysql There is no mysql user/group ...
0
votes
0answers
24 views

Logrotate: using number of files as criteria of logrotate

What I am trying to achieve is archive all log files if number of them in a folder exceed some number. Is it possible somehow ? EDITED: to be more detailed, I'll have possible several thousands of ...
1
vote
0answers
25 views

logrotate seems to be working but does not rotate a log file

Here is my logs directory: root@my-server:/var/www/vhosts/my-website/logs# ll total 1468016 -rw-r--r-- 1 my-website webuser 95719295 Mar 19 18:04 my-website-access.log -rw-r--r-- 1 my-website ...
1
vote
1answer
31 views

Log Rotate doesn't rotate logs [duplicate]

I have a logrotate running on Aws ec2 instance which is trying to rotate logs under /var/log/tomcat8/ every hour. I have below configuration under /etc/logrotate.d/rotate_tomcat: "/var/log/tomcat8/...
0
votes
0answers
26 views

Logrotate daily+maxsize not working

I have set the logrotate on centos7 with the max size and daily directives. But, it seems that it's not working when log size exceeds the specified size limit. Even in debug mode, it indicates that ...
0
votes
1answer
103 views

SELinux logrotate issue

It seems the topic is quite popular... So I figured I have issues with my logrotate not being able to rotate tomcat logs. Logrotate configuration is set in /etc/logrotate.d/tomcat as /opt/tomcat/...
0
votes
1answer
33 views

logrotate mysql not deleting old files

I have set logrotate for MySQL as follows: /var/lib/mysql/SITE1-L-MPKI-01.log { create 640 mysql mysql daily rotate 7 missingok compress copytruncate postrotate # just if ...
0
votes
0answers
53 views

Logrotate configuration for Syslog-ng failing to remove files

I have a requirement to purge syslog-ng files for our firewalls every 2 days. Logrotate is running using the following config: /var/log/syslog-ng/<firewallType>/<firewallName>/*.log { ...
2
votes
1answer
128 views

log-rotation not working properly

I have created log rotation but it seems not working for me, as it's creating a large number of files like "smartfox.log.2020-01-05-07.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1" Furthermore, rotate 3 and ...
3
votes
1answer
119 views

Logcheck Ignore Logrotate

I inherited a system using both logcheck and logrotate. The issue I'm having is that logrotate is sending a nasty e-mail saying something along the lines of: *** WARNING ***: Log file (X) is smaller ...
0
votes
1answer
461 views

How to Change Default System Wide UMASK on Ubuntu 18.04?

The default umask on 18.04 LTS is 0022. I want to set it to 0027 system wide. So for example when logrotate renames old log files, it respects the 0027 umask. There are no logins on the system only ...
0
votes
0answers
38 views

Unable to keep raw logs for more than one day with logrotate before compression

I asked this on stack overflow, but was told that it would be more appropriate to ask it here on serverfault. I'm trying to set up logrotate with the following logic: -keep the raw logs from 1 to 4 ...
0
votes
1answer
455 views

How to move compressed files with logrotate

This is probably insanely easy to do, but I can't find anything relevant to the topic. I'm setting up a custom logrotate.conf file for the logs in our service. As part of this, I would like to keep ...
0
votes
2answers
99 views

Log files randomly stops writing to log files

I'm currently running Debian 10.1 x64 The problem started pretty much right after setting up the server. Every now and then it seems like my system stops writing to the log files. If I check /var/log ...
0
votes
0answers
28 views

Centos - logrotate won't rotate

I have /etc/logrotate.d/httpd settled as : /var/log/httpd/* { rotate 3 size 10k missingok notifempty sharedscripts postrotate service httpd restart endscript } but ...
2
votes
1answer
74 views

Apache outputting without .log

I am trying to fix an issue where an apache log is filling the /var/log/ partition. It is a single log in apache2 that is almost 4GB. I have set logrotate to rotate out at 3G, but it has not rotated ...
0
votes
0answers
51 views

Oracle logs rotation is not working with logrotate Utility

I am trying to rotate Oracle log file extension (.log and .xml). I am trying to make one good script to work with everything from less growing logs to big growing logs everyday. /u01/app/db/trace/*....
0
votes
0answers
93 views

httpd not closing old log files on graceful restart

We are rotating httpd (2.4.6) logs with logrotate (3.8.6) on an RHEL7 server. The log rotation seems to be working successfully, the old logs are deleted from the fs and new logs created. We are ...
0
votes
0answers
107 views

logrotate problems after resetting mysql root password

A while ago, I had to reset my forgotton root password for mysql (strictly speaking mariadb) along a suitable how-to (might have been this https://devanswers.co/how-to-reset-mysql-root-password-ubuntu/...
3
votes
1answer
393 views

Configuring NGINX for GDPR (= RGPD, DSGVO) compliance using anonymized IPs on older log files

The European General Data Protection Regulation Law (GDPR) aims to protect end users privacy. Among many other consequences, system administrators are therefore obliged to configure their systems in a ...
0
votes
0answers
227 views

logrotate not rotating my logs for a specific folder (tomcat) on AWS CentOS7

Instance- CentOS 7 Logrotate version: logrotate 3.8.6 I am rotating my logs using logrotate and it shows the output as: "log does not need rotating (log has been rotated at 2019-7-19 3:43, that is ...
0
votes
0answers
18 views

When appending to a file, does bash keep that file in memory

I have a long running python program that logs to a file. I start program and let it run in the background python my-process.py >> /var/log/my_log.log 2>&1 & The free memory ...
0
votes
1answer
85 views

Why “|| true” and >/dev/null expressions are so often used in logrotate postrotate configuration?

There are coutless examples of logrotate configs which contain the following: postrotate systemctl reload nginx 1> /dev/null 2> /dev/null || true endscript but what is the motivation behind ...
1
vote
2answers
186 views

gzip softlocks every midnight during nginx log rotation, causes kernel panic

Some of our servers run on Ubuntu 18.10. They host a few Node.JS services receiving TCP connections as upstream from nginx, as well as a websocket implementation in Dotnet Core. It's a fairly simple ...
0
votes
1answer
300 views

logrotate prerotate script only fires for first log file, not all log files

We're using a prerotate script to upload our server logs to an S3 bucket in AWS. Here's the logrotate script: /var/log/nginx/*.log { daily missingok rotate 14 compress ...
0
votes
1answer
517 views

Logrotate not working with “Maxsize” with cron job configured

Thanks in advance. I have a server acting as a syslog-ng server and receiving logs from multiple network devices. These files increase in size quickly so I created logrotate file with the below ...
1
vote
0answers
85 views

Logrotate not rotating without size config

On RedHat, I have a logrotate configuration as follows : /custom/path/kibana/logs/*.log { missingok daily create 0644 suuser suuser rotate 7 notifempty sharedscripts compress dateext ...
1
vote
0answers
149 views

Using logrotate to only compress and delete old files without rotating

I want to compress some log files which have name format as abc.log.yyyy-MM-dd and then delete the compressed log file (abc.log.yyyy-MM-dd.gz) after x days.I don't want logrotate to rotate files(i.e. ...
1
vote
0answers
447 views

pm2-logrotate rotates standard error but not standard output

pm2-logrotate rotates standard error but not standard output. This is the content of ~/.pm2/module_conf.json { "pm2-logrotate": { "max_size": "10M", "retain": "30", "...
0
votes
0answers
80 views

Logrotate not removing the logs

I have the following logrotate script /path/to/folder/*.logs { daily rotate 30 notifempty sharedscripts copytruncate compress dateext preremove if file --mime-type "$1" ...
1
vote
1answer
151 views

The logrotate 'rotate' directive and migrating from daily to weekly

I have a server collecting syslog messages from the network. Logrotate is currently setup and working, and the config looks like such: /logs/*/log { daily rotate 60 } Instead of rotating ...
3
votes
1answer
534 views

Does logrotate.conf override the config of the submodules?

I wonder which of the logs takes precedence over the other. Looking at rsyslog defined here, it defines daily rotation and keeping them for 30 days. vim /etc/logrotate.d/rsyslog /var/log/syslog { ...
2
votes
0answers
78 views

Logrotate and “insecure permissions”: What can actually go wrong?

Logrotate complained to me this morning that it would not rotate some logs because their parent directory is writeable by someone else than root. The man page states I can make the error message go ...
2
votes
1answer
40 views

Logrotate isn't deleting old files

I have a daily backup running using logrotate. I don't have root access to this machine to edit the normal logrotate.conf, therefore I'm calling it via crontab like so: 0 4 * * * /usr/sbin/logrotate /...
0
votes
1answer
405 views

Issue : log-rotate is not working

I am configuring log rotation one of my production server. I am having a weired issue. I have configured the log rotation for a file on daily basis. But unfortunately the rotation is not working. I ...
1
vote
1answer
2k views

Logrotate: glob finding old rotated logs failed

I am having problems with logrotate. The configuration is the following /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/unused.log /var/log/kern.log /var/...
1
vote
3answers
2k views

wildfly and logrotate: wildfly still logs messages to already rotated server.log

For wildfly (on linux) I need following logging scenario: daily rotation of server.log and removing old log files which are older than 90 days. I don't see a way to configure this in wildfly/log4j (...
2
votes
1answer
2k views

logrotate: What means the message “log has been already rotated”

If I run logrotate I get log does not need rotating (log has been already rotated) and the log file is not rotated. Why that? My log rotate conf: /var/log/capp/*.log { missingok rotate 90 ...
0
votes
1answer
682 views

Missing log rotations

One of my servers ran out of space recently. So I started looking into it. The nginx logs took half of the partition. Also, I noticed a strange thing. For a lot of sites (60%) extra rotations where ...
1
vote
1answer
147 views

What does the --force flag change about the behaviour of logrotate?

I am trying to find out why logrotate is only rotating a subset of logfiles in a folder when run without the --force flag. The man page for logrotate --force simply says: Tells logrotate to force ...
1
vote
1answer
1k views

Apache2 segmentation fault errors after every midnight

I am seeing a strange error with my ubuntu dev machine. It is going on since almost a year. Meanwhile I have reinstalled ubuntu at every release (not just upgraded to the next release). Every day ...
1
vote
1answer
56 views

Strange log rotation using logrotate file

I have setup log rotation for postfix with a logrotate config file as follows: /var/log/mail.* { rotate 7 daily missingok notifempty delaycompress ...
1
vote
1answer
169 views

Logrotate hourly will this restart my process

I'm looking at switching my log rotate setup to rotate logs hourly instead of daily. I think I've got the config ready to go but wanted to check whether the config would trigger a reload/restart of ...
1
vote
0answers
69 views

logrotate skipped a number in it's rotation… and then recovered?

I'm running an embedded system using a Yocto derived Linux distro. kernel version:4.1.15-2.0.0. We need to manage the logs and do so with logrotate. The requirements are that we have 72 hours of logs,...
0
votes
0answers
177 views

How to open multiple log files with less and logrotate?

I use logrotate for nginx and php logs. By default it names files like: access.log access.log.1 access.log.2.gz ... access.log.10.gz I want to open all of the log files in less so I can search ...

1
2 3 4 5
8