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
1
vote
1answer
21 views

Logrotate daily issue

I have a problem with logrotate. Each day I have a script that saves over 180 configs froms switchs and routers. Via tftp it puts the files into /scripts/backups/ with the text extension. The names of ...
0
votes
0answers
36 views

Logrotate with nocreate not working

Below is my logrotate config. #copytruncate #nocreate compress dateformat %Y-%m-%d. dateext extension log /opt/logs/events/security_*.log { olddir /opt/archive_logs/events/ nocreate ...
0
votes
1answer
42 views

How to configure log rotate to compress and archive logs weekly [closed]

We have rsyslog that save logs based on requirement to various directories: /opt/logs/stats/dc1/stats_YYYY-MM-DD_%somename%.log /opt/logs/stats/dc2/stats_YYYY-MM-DD_%somename%.log /opt/logs/events/dc1/...
0
votes
0answers
29 views

Logrotate for seperate Apache vhost logs without restarting Apache multiple times

I have several Apache virtual hosts with each one logging access and errors to log files in its own directory, not the main Apache log. I'd like to use logrotate to rotate the vhost log files. I'm ...
0
votes
0answers
23 views

Nginx/Openresty keeps creating an empty log file and writes in the previous one causing logs to never get rotated

My Django app runs on an nginx/openresty server. The user running the server is root:root but typically the app is owned by webapp:webapp. This means logs get created and written on by root. The ...
0
votes
0answers
25 views

How do I color/format logs and also rotate without one action getting in the way of each other?

I have the following: A shell script which gets executed via screen and a screenlog gets generated using the flag -L. This shell script is just ncat (better version of netcat) listening on a specific ...
0
votes
1answer
61 views

logrotate postrotate seems not being executed

I have this configuration on Ubuntu 20.04: /home/impulse/nginx/log/*/notice.log /home/impulse/nginx/log/*/access.status_ok.log /home/impulse/nginx/log/*/access.status_erro.log { daily nomail ...
1
vote
1answer
43 views

Logrotate Says It Rotated Logs, But Didn't

OK, here's my situation. I'm trying to use logrotate to rotate VNC logs for a specific user on an hourly basis. Based on the feedback I get when I run the utility, the log rotation goes off, but ...
0
votes
1answer
65 views

How to rotate compressed log file on centos 7?

I have customized kafka server and the app is creating log files and configures log rotation. My problem is that I need to compress the rotation logs that were created. I tried to create new log ...
1
vote
0answers
25 views

Is that possible to let “multilog” program output human-readable file name instead of TAI64N timestamp name?

I am using "multilog" to do log rotation in debian server. When the log roates, "multilog" will create a filename as @TAI64N_timestamp.s or @TAI64N_timestamp.u. I know I can ...
0
votes
0answers
33 views

can I rotate log based on file creation time?

I have logrotate config like this: /var/log/example*.log { weekly rotate 1 missingok notifempty compress } Some of the example*.log files have existed for quite long time more ...
0
votes
1answer
44 views

Rsyslog rotates, but still logging to old log

Server: Ubuntu Server 14.04 I have a Watchguard Firebox logging to a server. It is supposed to rotate daily, however, when the rotate occurs, it doesn't write to the new log. It keeps writing to the ...
1
vote
0answers
34 views

Logrotate permission errors when using compress

I'm struggling to make logrotate work. Basically I just want to have a cronjob run once an hour to rotate my logs. Now I had this working initially but logrotate completely crapped itself and stopped ...
1
vote
0answers
22 views

logrotate not rotating file, but is running

Running CentOS 7 and have several logrotate scripts. For the past several days I've noticed it hasn't rotated my files. When I check logrotate.status it says it ran, but my logs are indeed not ...
0
votes
0answers
20 views

Rotate logs at specific time?

I have several logs that are rotated daily (servers are CentOS) and another script triggered in crontab that does some analysis stuff with those logs. The script relies on the logs being done by a ...
0
votes
0answers
13 views

How should I track down logrotate error 'Module ipaddress not found.' when it happens only sometimes?

I have a logrotate setup as described in Question 980831, i.e. I use an anonymization script in postrotate and then rename the file. For some reason, I get the following error from time to time. It ...
0
votes
0answers
20 views

Logrotate order and include

Can someone confirm if the main logrotate conf is ignored, used or partly used when an application (in my case sssd) is included and has it's own conf in logrotate.d main conf contains create, daily ...
1
vote
1answer
52 views

Null after logrotate copytruncate

I am using logrotate to manage my logs. As I have to manage a bunch of log files. My logrotate config looks like /log/typeA*.log /log/typeB*.log /log/typeC*.log{ daily rotate 7 ...
0
votes
0answers
27 views

Logrotate configuration with overwrites

I'm trying to create logrotate config for an application. I've got log directory /<same_path_to_file> with multiple files in there. I want to rotate most files the same way but with 2 exceptions ...
0
votes
1answer
63 views

Logrotate wtmp `su prime gadmin` Contabo Ubuntu 20.04

Logrotate gives error in Ubuntu server 20.04 from Contabo VDM: Oct 31 00:00:01 foo logrotate[364456]: error: wtmp:3 unknown user 'prime' Oct 31 00:00:01 foo logrotate[364456]: error: found error in /...
0
votes
2answers
72 views

Is logrotate supposed to work only in logs inside /var/log?

I currently have a systemd service in a Ubuntu 18.04 machine that redirects the StandardOuput and StandardError to a custom path: StandardError=file:/opt/my_tests/my.log StandardOutput=file:/opt/...
2
votes
1answer
574 views

NGINX service rotate doesn't use new log files

I'm having issues with any commands which tell nginx to use new log files. I'm using Ubuntu 18.04, nginx/1.14.0, logrotate 3.11.0 If I create new access.log or error.log files in /var/log/nginx, ...
0
votes
0answers
23 views

How does logrotate handle an initial entry in logrotate.status?

I have two files to rotate, one file called error.log and one file called info.log. I created both files and a logrotate script yesterday at around 14:00. The log files shall be rotated to a sub path ...
0
votes
1answer
88 views

How to sort incoming log messages by their hostname & timestamp with Rsyslog?

I was curious if anyone has sorted incoming logs captured by Rsyslog by hostname and time stamp in the log. Right now I have Rsyslog sort messages by the hostname moving them to appropriate folders ...
0
votes
0answers
161 views

Create custom logrotate for remote logs

Hi this is related to this question. I am running CentOS8 + SELinux set to enforcing. I need some info on how to properly create a logrotate for my remote logs that use the template of $template ...
0
votes
0answers
61 views

logrotate -> gzip 100% CPU usage after boot

I have Ubuntu 20.04. After booting or returning from suspention my CPU goes into 100% usage thanks to (root) gzip process. After I checked dependencies with: ps fax | grep -B5 gzip It turned out that ...
0
votes
1answer
89 views

Logrotate - Is there a conflict?

/etc/logrotate.d/auth.conf is somnething I created manually. But there is a entry for /var/log/auth.log in /etc/logrotate.d/rsyslog as well. Is there a conflict? Do I have to remove auth.log entry ...
0
votes
0answers
394 views

error: error creating output file /var/lib/logrotate.status.tmp: Permission denied

I am trying to logrotate my log files. Here is my configuration file: /home/deploy/apps/production_app/current/log/*.log { daily missingok rotate 52 compress create 0644 deploy ...
0
votes
0answers
14 views

logrotate broken yet not error message

It seems like there are quite a few common issues with logrotate not doing what it suppose to and as it happens I am in the same boat. -rw-r--r-- 1 root root 24G Jun 23 01:15 A10.log -rw-r--r-- 1 ...
1
vote
1answer
56 views

logrotate mariadb not workin as expected

i'm trying to configure logrotate for mariadb log files, Environment: system : RHEL 8.2 logrotate : 3.14.0 mariadb: 10.4 the file is /var/lib/mysql/SITE2-L-MANAGEDPKI-01.log{ missingok ...
1
vote
0answers
72 views

docker: logrotate is failing with missing directories in pattern

I'm using logrotate in a docker container. I'm injecting a bind volume into the container where logs should be rotated. The folder structure is more or less the same, this path /srv/apps is injected ...
1
vote
0answers
292 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 ...
1
vote
0answers
232 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
1answer
632 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/...
1
vote
1answer
138 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
26 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
91 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
163 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
1answer
622 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
62 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 ...
2
votes
1answer
294 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 ...
4
votes
1answer
255 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
2k 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 ...
1
vote
1answer
1k 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
300 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
32 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
382 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/...
4
votes
1answer
859 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
25 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 ...

1
2 3 4 5
9