As of May 31, 2023, we have updated our Code of Conduct.

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
2 answers
64 views

Logrotate group of files if any member is eligible

I have a group of log files (they are related but that's application level and not relevant). I want to set up logrotate configuration on Debian linux to rotate the whole group (all the files) once ...
wick's user avatar
  • 147
0 votes
1 answer
42 views

Nginx doesnt' log into access.log

I'v been struggling with Nginx logging. A problem that I found out first was logrotate failure. so I've changed user to the same owner of nginx worker process which is www-data and I forced logrotate, ...
Taylor's user avatar
  • 1
0 votes
0 answers
23 views

How many times will postrotate run when defining logrotate for multiple directories?

I have the below configuration for rotating the DB backups. The /var/mysql_backup/data/ contains two subdirectories db1 and db2. /var/mysql_backup/data/*/db.sql.gz { daily rotate 7 ...
Niyaz's user avatar
  • 103
0 votes
0 answers
144 views

logrotate works manually but not works automatically via cron on Ubuntu 18.04

I have a logrotate task to rotate my nginx logs. I have my config file in /etc/logrotate.d/nginx. When I run logrotate -f /etc/logrotate.d/nginx, it can rotate the logs correctly, which means my ...
Hank Chow's user avatar
  • 111
0 votes
0 answers
48 views

selinux file context precendence, logrotate and httpd

UPDATE: figured out the issue, its with my fcontext path expression I have to use semanage fcontext -a -t logrotate_tmp_t "/etc/httpd/logs(./*)?" instead of semanage fcontext -a -t ...
Jimmy Chi Kin Chau's user avatar
1 vote
2 answers
227 views

Logrotate is not working in /tmp

I'm facing a strange problem with logrotate on my Debian 10 server. All in one, logrotate (v3.20.1) is working and rotating fine... except for some files in /tmp that I want to "skrink" ...
sbocquet's user avatar
0 votes
0 answers
39 views

rsyslog is not capturing logs from remote server post log rotation

I have configured the rsyslog on my CentOS-7 server to receive logs from a network device. And, it is receiving logs at the configured file path. But, when the logroatation is done, it creates a new ...
Sophie's user avatar
  • 1
2 votes
1 answer
102 views

logrotate fails to run Java postrotate program

Somewhat recent versions of logrotate fail to execute postrotate actions that invoke Java when logrotate is started via systemd. In my logs I see: logrotate[123]: Error occurred during initialization ...
C-Otto's user avatar
  • 334
-1 votes
2 answers
281 views

ESXi rotate logfiles by hours

ESXI: 70u2 Hi, I can't found "/etc/logrotate.conf", I understand he don't exist in this version. In the file "/etc/vmsyslog.conf" I can specify some options, the split by size has ...
CH06's user avatar
  • 13
0 votes
0 answers
357 views

Can run daily logrotate without cron?

On my docker, i use amazonlinux:2 at this default enviroment not install cron. I want to use logrotate for rotating log of application every daily. Can Logrotate work automatic without cron? This file ...
VoVuong's user avatar
1 vote
0 answers
145 views

Logrotate Create Mode Issue

I have a trouble with logrotate service in linux. I have a logrotate config for mongodb log as below: /var/log/mongodb/mongod.log { rotate 10 daily dateext dateformat %Y-%m-%d-%s ...
Fatemeh Davoudi's user avatar
0 votes
1 answer
795 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 ...
chrisinmtown's user avatar
0 votes
0 answers
124 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/...
vansh kumar's user avatar
1 vote
0 answers
240 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 ...
Jacques Amar's user avatar
0 votes
1 answer
2k 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'. ...
theirman's user avatar
0 votes
0 answers
1k 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 ...
dm90's user avatar
  • 101
1 vote
1 answer
637 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 ...
Maestro223's user avatar
0 votes
1 answer
141 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.. 's user avatar
1 vote
1 answer
1k 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 ...
rdi_pck's user avatar
  • 31
0 votes
1 answer
327 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 ...
TS_'s user avatar
  • 3
1 vote
1 answer
253 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 ...
justanotheruser1019's user avatar
1 vote
1 answer
2k 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 ...
DevOpsSauce's user avatar
1 vote
2 answers
6k 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 ...
Maestro223's user avatar
1 vote
1 answer
34 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 ...
IoNuTz's user avatar
  • 11
0 votes
1 answer
1k 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/...
sarvesh.lad's user avatar
0 votes
0 answers
546 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 ...
dabadaba's user avatar
  • 101
0 votes
1 answer
595 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 ...
Niloct's user avatar
  • 101
1 vote
1 answer
371 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 ...
Jeff D.'s user avatar
  • 11
0 votes
1 answer
367 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 ...
Rasa's user avatar
  • 1
2 votes
0 answers
142 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 ...
sgon00's user avatar
  • 163
0 votes
1 answer
939 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 ...
DevOpsSauce's user avatar
1 vote
0 answers
567 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 ...
sjaak's user avatar
  • 111
1 vote
0 answers
94 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 ...
Phaelax z's user avatar
  • 111
1 vote
1 answer
506 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 ...
Pranjal Doshi's user avatar
0 votes
1 answer
119 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 /...
Miroslav Popov's user avatar
0 votes
2 answers
2k 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/...
ignacio's user avatar
  • 101
4 votes
1 answer
6k 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, ...
x3nr0s's user avatar
  • 289
0 votes
1 answer
335 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 ...
cabotek's user avatar
0 votes
1 answer
358 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 ...
user630702's user avatar
0 votes
0 answers
2k 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 ...
Zia Qamar's user avatar
  • 111
0 votes
0 answers
37 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 ...
Maciej Cygan's user avatar
1 vote
1 answer
452 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 ...
Hachem Bouhlel's user avatar
1 vote
0 answers
182 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 ...
Marco's user avatar
  • 11
2 votes
0 answers
792 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 ...
Dmytro Titov's user avatar
1 vote
0 answers
605 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 ...
usilo's user avatar
  • 11
0 votes
1 answer
3k 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/...
Bas van den Dikkenberg's user avatar
1 vote
1 answer
482 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 ...
lonix's user avatar
  • 871
0 votes
0 answers
42 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 ...
Adam Bator's user avatar
1 vote
0 answers
166 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 ...
ticktockhouse's user avatar
1 vote
1 answer
442 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/...
krish's user avatar
  • 13

1
2 3 4 5
9