Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
20 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 ...
0
votes
2answers
78 views

How does logrotate deal with copytruncate?

I understand that copytruncate is not an ideal setup, but that's the cards I'm dealt with... I have a service that is tailing data from journalctl and streaming it to a file. The setup to rotate the ...
0
votes
0answers
48 views

Logrotate is not rotating the logs

I have an Ubuntu 14 server and currently, am trying to rotate my Nginx log files hourly. But since I have changed the logrotate config the logs are not rotated. New logrotate config. /var/log/nginx/*...
0
votes
0answers
36 views

How to use hourly support in logrotate (3.8.7)?

I currently have logrotate version(3.8.7). I would like to use the new hourly feature which was introduced in (3.8.5). I have tested forced logrotation for testing, but I need to set it for daily ...
0
votes
1answer
44 views

Why isn't logrotate working on particular log files? Permissions and config the same. Debian Linux

I can't get my sites' access logs to rotate. The default log files are rotating fine, and permissions and logrotate conf file lines are the same as those, but they don't get touched for some reason. I ...
0
votes
0answers
5 views

Logrotate truncates log lines on rotation

using apache DC/OS / Apache Mesos, the logs are written to stdout on the console and DC/OS / Apache Mesos streams to a file and configures Logrotate using the below basic config. "/.../.../stdout" { ...
0
votes
1answer
36 views

where is rotation policy of logs under /var/log/messages-*

I would like to know how messages log file /var/log/messages are rotated. I checked in /etc/logrotate.conf file and inside /etc/logrotate.d/ directory but nothing that could explain the rotation. ...
0
votes
1answer
43 views

Logrotate Separate Policies in Same Directory

I am running rsyslog on CentOS and logrotate to rotate my logs. All hosts write their logs to /var/log/syslog/ in their own separate directory in this manner: /var/log/syslog/host1 /var/log/syslog/...
0
votes
0answers
68 views

cron.daily executing, but LogRotate command not running

I'm a bit of a Linux noob, I'm using a RHEL system, and have been trying to set up a logrotate. I've added the following to /etc/cron.daily/logrotate #!/bin/sh whoami > /logs/whoami.txt /usr/...
1
vote
1answer
53 views

Log rotation not happening with cron job- files are symlinked and forceful log rotation works

I am facing issue with logrotation with 2 of my custom files. The folder where they reside - /var/log/test is symlinked to /sample/var/log/test cron.daily log which picks up logrotate: Sep 12 03:20:...
0
votes
1answer
128 views

Logrotate Not Deleting Compressed Logs

I have a CentOS box running rsyslog and logrotate as my syslog server for a whole bunch of network devices. I've been toying around with this for a while, the logrotate/compression piece is working ...
0
votes
1answer
16 views

Daily Log Rotation - retaining original

I'm working on Ubuntu 14.04 hosting a graylog server. In the /var/log/upstart/ directory, I have a plaintext log of all the messages that come in - it's set to rotate every 3GB. However, the problem I ...
0
votes
0answers
46 views

Does logrotate check diskspace before rotating a logfile?

I am trying to figure out how logrotate work regarding disk space but not able to figure it out? Scenario: Let say I have 2GB of the log file and free disk space is also 2 GB, does logrotate first ...
0
votes
0answers
17 views

Logrotate truncates line when rotating file?

using logrotate through Mesosphere DC/OS. I have my log setup to rotate every 4MB for example. But every few rotations, I get a log line that gets truncated in half. I.e: The first part of the line ...
0
votes
3answers
888 views

rotate logs with logrotate and move old files

Logrotate don't move file to oldlogs folder and exit abnormally with code 1. I tried to launch manually it with -d option but no errors are showed. This is my configuration: /var/log/myfolder/*.log { ...
0
votes
1answer
24 views

What does set logtarget Syslog 2 mean in logrotate.conf file?

I am using latest version of CentOS with NGINX. My Logrotate.conf file has two blocks/directives for fail2ban log (maybe it was a mistake by my previous hosting provider). Therefore, I am receiving ...
0
votes
0answers
93 views

logrotate include more similar directories

I'm using logrotate for my apache access/error logs. I have many subdomains with the same configuration. /basedir/www/mysubdomain/logs So I programmed my logrorate with /basedir/www/*/logs/*.log { ...
0
votes
0answers
181 views

apache mod_wsgi failure on apache reload (logrotate)

We have an application that has been running for a few weeks, now. Today, for the first time, it is returning a lot of 503 errors. A few requests succed, but most get a 503. It is a Flask application ...
1
vote
0answers
40 views

What happens when svnserve gets stopped (SIGKILLED) while a commit is in progress?

What happens when svnserve gets stopped (SIGKILLed) while a commit [to an FSFS repository] is in progress ? (I mean has svnserve been made robust enough to handle this, say upon restart, or must the ...
0
votes
0answers
15 views

How to email log file as attatchment instead of body? [duplicate]

Add the below line in my /etc/logrotate.conf. mail xxxx@yahoo.com Some log files rotated will write into email's body and send to my xxxx@yahoo.com. How to put all the rotated log file as ...
0
votes
1answer
159 views

MongoDB logrotate with occasional file size changed while zipping error

I use this script for rotating MongoDB v3.6.3 logs: /var/log/mongodb/mongod.log { weekly rotate 52 compress missingok notifempty sharedscripts ...
0
votes
1answer
393 views

Run anacron at 11:59 PM

I am trying to run may logrotator using following anacron setup to run it at 11:59 PM as daily task. My current setting for /etc/anacrontab # /etc/anacrontab: configuration file for anacron # See ...
0
votes
1answer
254 views

Apache rotatelogs command is failing and apache doesnt restart [closed]

I have a command to implement rotatelogs for access logs of apache, but when I am trying to restart my apache server, it doesnt start and throws me an error in error.log as: The parameter is ...
0
votes
0answers
41 views

Logrotate installed, settings for nginx duplicated between two servers…but different log file sizes

I have two web servers, using nginx, I have logrotate installed on both, and the settings for both logrotate.conf and logrotate.d/nginx are both the same. Both store logs in /home/websitename/.pm2/...
3
votes
0answers
904 views

kubernetes kubelet logging to files and logrotate

kubelet has an option to store log files in a log-dir (https://github.com/kubernetes/kubernetes/issues/21248). I start kubelet with the options --logtostderr=false --log-dir=/var/log/kubelet (I have ...
1
vote
1answer
372 views

awslinux /etc/cron.daily doesn't execute logrotate file

sorry about low level english IN MY STAGING SERVER I want logrotate every day(nginx) so I create logrotate file in /etc/logrotate.d/ /etc/logrotate.d/nginx /var/log/nginx/*log { create 0644 ...
0
votes
1answer
1k views

Logrotate postrotate: Log file name variable empty

According to the logrotate manual (https://manpages.debian.org/jessie/logrotate/logrotate.8.en.html), logrotate should invoke a script and hand over the filename of the rotated file as the first ...
1
vote
1answer
579 views

logrotate status files extremely large

Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/...
2
votes
2answers
330 views

How does one keep a file's timestamp (date modified) after a logrotate?

Title says it all, I have a log rotate set up daily for some rather large log files. Sometimes we can generate 3 of these a day, sometimes we only generate 1, they're each about 500MB. Is there a way ...
1
vote
2answers
282 views

Some logs rotated to log.1 some to log.1.gz

Some files are zipped to 1.gz /var/log/apt/history.log.1.gz /var/log/apt/term.log.1.gz /var/log/mosquitto/mosquitto.log.1.gz /var/log/mysql/error.log.1.gz Some are not zipped, first the second level ...
0
votes
1answer
330 views

Conflicting Logrotate Permissions

I've got a folder full of log files, and I'm using logrotate to rotate them. Until recently, I only had Apache log files in there - access.log and error.log. I've added a new log from a daemon, ...
1
vote
1answer
157 views

SELinux denies “systemctl kill” when used in Anacron postrotate script on CentOS 7

I'm using backup software called UrBackup, which I've configured to rotate its logs once a day through cron.daily. After the logs are rotated, the software uses a postrotate script to send the running ...
0
votes
0answers
297 views

Logrotate is not working

Thank you for reading my question. I am not a sysadmin expert so, sorry if I am asking a newbie question. I have configured logrotate to rotate a custom file, but it is not working and I don't find ...
0
votes
1answer
704 views

Logrotate with `copytruncate` “data loss” - is it serious?

Manpage of logrotate claims that using copytruncate option leads to "a very small time slice between copying the file and truncating it, so some logging data might be lost". Is it actually ...
0
votes
0answers
965 views

How to setup logrotate properly for multiple systemd services, which sends their stdout, stderr to rsyslog

Suppose I have many systemd service units on ubuntu 16.04 which looks like this: [Unit] Description=Do something script After=default.target [Service] ExecStart=/usr/local/sbin/some-script-x.sh Type=...
1
vote
1answer
1k views

Logrotate maxsize with minsize

I wonder if maxsize and minsize can both be added with a specified time interval and can thus coexist. With these options both the size and timestamp of a log file are considered, so if it happens ...
0
votes
2answers
694 views

Mongo forcing a log rotation on Windows

I was wondering how I can setup log rotation for a MongoDB on Windows. I'm only reading it for Linux and Unix based systems in the documentation. Does anyone know how I can set this up? https://...
0
votes
1answer
2k views

logrotate prerotate script not getting name of file to be rotated

I am having trouble with the prerotate script in logrotate 3.12.2. The script I specify in the prerotate/endscript section is not receiving the name of the file to be rotated as the first argument ($1)...
0
votes
0answers
88 views

CentOS 6 - Logrotate Confusion

I'm trying to get logrotate to rotate some logs for me. I feel like this should be simple, but it doesn't seem to be behaving as I would expect. Here's my config: /path/to/log/files/specific_file /...
2
votes
1answer
337 views

How logrotate behave when there is * and there is one explicit filename in log rotation in one path?

The question is little bit long! Let me explain with the example below. I have a log-rotation configuration file in /etc/logrotate.d/ which is used for uwsgi: "/var/log/uwsgi/*.log" "/var/log/uwsgi/...
0
votes
1answer
288 views

syslog-ng 3.2.5 server stops receiving data, possibly related to logrotate

I asked this question in Unix & Linux but I think it actually fits better here. Currently, I use the following logrotate.d configuration /var/log/messages { daily compress rotate ...
0
votes
2answers
420 views

Rsyslog not forwarding when running as service

I have 2 local VM's running CentOS 7 to simulate our production environment. 1 proxy server and 1 centralized (ELK) server. On the ELK server is running logstash to collect al syslogs from running ...
3
votes
1answer
2k views

How to combine logrotate with Log4j “rolling” file-appender?

We have a Java-application, that uses log4j and rotates its own logs daily: The currently-used log-file is /var/log/foo/foo.log It is moved into /var/log/foo/foo.log.YYYY-MM-dd when the day changes ...
3
votes
1answer
1k views

Elastic Beanstalk Log Rotation Causing Apache Restart

I have already worked through AWS Elastic Beanstalk - Apache is restarting constantly Our elastic beanstalk instances are reporting the following message in the error_log [Mon Jun 26 22:01:01....
0
votes
1answer
142 views

Launch script after dockercloud/logrotate rotate log

I'm using DockerCloud for my RESTful API micro services and I use LogDNA to see log of logs of my containers. I use logspout to send log to LogDNA and it's working great until dockercloud/logrotate ...
2
votes
2answers
686 views

error: error creating unique temp file: Permission denied

while executing logrotate script manually I am receiving an error as follows. $ logrotate -vf /apps/web/scripts/Logroate-web.conf truncating /apps/oracle/admin/mserver/adf12dev/servers/adf_1/logs/...
3
votes
1answer
5k views

logrotate by size - do I need to change the cron?

My current logrotate configuration looks like this (using logrotate 3.8.7) "/var/log/haproxy.log" { daily size 250M rotate 1 create 644 root root missingok compress notifempty ...
-1
votes
1answer
22 views

Verify that Logging is up and enabled

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME httpd 1744 apache 16w REG 202,1 0 167906281 phpapi_access_log httpd 2334 apache 16w REG 202,1 0 167906281 ...
0
votes
3answers
1k views

Ideal log rotation configuration for overloaded site

I've been in charge of a server that has been stressed beyond its tipping point for some time. I've recommended changes that are currently in the process of being implemented by other members of the ...
0
votes
1answer
5k views

logrotate configuration on linux to rotate syslog-ng log files correctly

I am having some trouble trying to configure log rotation for some syslog-ng local log files I'm trying to keep. for some reason, the size is not respected and logs are filling my filesystem quickly. ...