Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
0 answers
9 views

apache in docker: best practice to manage logs written to mounted volume?

What the best practice to write and manage log files written by Apache HTTPD running in a container? We run Apache HTTPD using docker base image httpd:2.4-bullseye. Right now HTTPD is configured to ...
user avatar
0 votes
0 answers
17 views

Logs are not shifting to new directory after log rotation

I am facing issue. We have setup log forwarder for sentinel and logs are frequently coming on /var/log/messages. Actual problem is i have created one script for log rotation and placed it under /etc/...
user avatar
0 votes
0 answers
27 views

logrotate on ubuntu 20.04.4 won't run *my config* in systemd

I have a a few processes that output logs to /var/tmp/ and /tmp/. I am trying to get logrotate to work on them using a file I have put in /etc/logrotate.d/. One set of files is generated by rsyslog ...
user avatar
0 votes
0 answers
18 views

Centos Httpd logroate not compressing files

Currently logrotate with httpd isn't writing to any of the log files and only writing to the old files that haven't been zipped with datestamps. Not sure what steps to take next. -rw-r--r--. 1 root ...
user avatar
0 votes
1 answer
43 views

How to properly configure a custom logrotate configuration file?

For the first time today, I am trying to write a configuration file for logrotate. When I restart the logrotate service, I get the following error: logrotate.service: Failed with result 'exit-code'. ...
user avatar
0 votes
0 answers
172 views

How to avoid data loss during log rotation in linux/kubernetes?

Brief We are running our workloads in kubernetes on AWS EKS. All our applications write the logs in /var/log/app_logs directory using hostPath. (yes it's not a best practice, this is due to legacy ...
user avatar
  • 101
0 votes
1 answer
83 views

Logrotate Fails Without Error

Ok, I made a boo-boo. I think Problem: Logrotate fails (or I incorrectly think its dead) and does not provide any error message to explain why: ● logrotate.service - Rotate log files Loaded: loaded ...
user avatar
0 votes
0 answers
49 views

Linux, want to rotate oldest one files when it reaches limit

We have one Linux RHEL Machine where different log files are generating everyday with current date time under "/var/log/audit/" location. File name are in below format: audit_2021-11-24....
user avatar
0 votes
1 answer
60 views

What is the default configuration for logrotate.conf in Ubuntu?

In /etc/logrotate.conf is user permission different from one ubuntu version to another? .... and why ?? as i found it like that in ubuntu 18.04 # use the syslog group by default, since this is the ...
user avatar
0 votes
1 answer
154 views

GitLab with local IP install hangs at logrotate

I am trying and failing to install GitLab (EE) onto an on-premises bare-metal server PC running Ubuntu Server 20.04. The server is intended to later have internet-facing access, but for now it needs ...
user avatar
0 votes
1 answer
133 views

How does logrotate work?

What exactly does logrotate do when it "rotates" a log file? For example, does it rename the existing file and create a new one with the old name? This article describes restarting a service ...
user avatar
  • 3
0 votes
0 answers
61 views

Why does a systemd script stop writing to a log after restarting the service?

I have a systemd unit file. It starts a php script. There was a network blip, which made me have to reboot after nothing else worked. I noticed that the script was no longer writing to the specified ...
user avatar
0 votes
0 answers
185 views

Is it possible to configure logrotation with Kubernetes manifest file?

I have a Kubernetes cluster on AWS(EKS). Each pod has a container that runs my application which drops huge log files. The containers have NFS mounted, so I want to use logrotate to preserve the ...
user avatar
0 votes
0 answers
22 views

In log rotation configuration file. I have to append the boot count

I have to append the boot count in log rotation file in this format: boot-0000001-syslog_1.log boot-0000001-syslog_2.log This is ...
user avatar
1 vote
1 answer
39 views

Rotation not executing when file size reaches certain threshold

I have the following configurations in /etc/logrotate.d/rsyslog: /var/log/syslog { rotate 7 size 1G missingok notifempty delaycompress compress ...
user avatar
0 votes
0 answers
160 views

Chrony doesn't rotate logs after logrotate

I have the following logrotate configuration: /var/log/chrony/*.log { daily missingok nocreate maxage 5 sharedscripts postrotate /usr/bin/chronyc -a cyclelogs > /...
user avatar
0 votes
1 answer
594 views

Logrotate not writing to new .log file

I have 4 custom systemd services that write to custom logs in /var/log/. I set up a logrotate config file, but it is not writing to the newest log. It is still writing to the old .log.1 file. The new ...
user avatar
0 votes
2 answers
2k views

Logrotate Service Failure

My logrotate service failes. It complains about a duplicate entry for modsecurity. ● logrotate.service - Rotate log files Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor ...
user avatar
1 vote
1 answer
28 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 ...
user avatar
  • 11
0 votes
1 answer
366 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/...
user avatar
0 votes
0 answers
169 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 ...
user avatar
  • 101
0 votes
1 answer
257 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 ...
user avatar
  • 101
1 vote
1 answer
215 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 ...
user avatar
  • 11
0 votes
1 answer
206 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 ...
user avatar
  • 1
1 vote
0 answers
68 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 ...
user avatar
  • 143
0 votes
1 answer
284 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 ...
user avatar
1 vote
0 answers
201 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 ...
user avatar
  • 111
1 vote
0 answers
43 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 ...
user avatar
  • 111
1 vote
1 answer
290 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 ...
user avatar
0 votes
1 answer
79 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 /...
user avatar
0 votes
2 answers
803 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/...
user avatar
  • 101
3 votes
1 answer
3k 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, ...
user avatar
  • 269
0 votes
1 answer
205 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 ...
user avatar
0 votes
1 answer
242 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 ...
user avatar
  • 103
0 votes
0 answers
1k 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 ...
user avatar
  • 111
0 votes
0 answers
27 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 ...
user avatar
1 vote
1 answer
218 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 ...
user avatar
1 vote
0 answers
115 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 ...
user avatar
  • 11
2 votes
0 answers
527 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 ...
user avatar
1 vote
0 answers
479 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 ...
user avatar
  • 11
0 votes
1 answer
2k 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/...
user avatar
1 vote
1 answer
274 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 ...
user avatar
  • 715
0 votes
0 answers
31 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 ...
user avatar
1 vote
0 answers
137 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 ...
user avatar
1 vote
1 answer
347 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/...
user avatar
  • 13
0 votes
1 answer
1k 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/...
user avatar
0 votes
1 answer
98 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 ...
user avatar
2 votes
1 answer
488 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 ...
user avatar
4 votes
1 answer
381 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 ...
user avatar
0 votes
1 answer
4k 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 ...
user avatar
  • 105

1
2 3 4 5
9