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.

learn more… | top users | synonyms

-1
votes
1answer
64 views

Continuous Log Rotation

I have implemented Log rotation as :- /data/mule/logs/*.log { rotate 1 size 20M missingok noolddir nomail notifempty create 644 root root compress } But the ...
-1
votes
1answer
21 views

Logrotate is not working centos 6.6

I have the following configuration for logrotating the app logs. /opt/tomcat/logs/app-web.txt { copytruncate daily size 500M compress delaycompress rotate 0 missingok ...
2
votes
2answers
17 views

Rotating a subset of logs with Logrotate

I have a number of files in /var/log/myapp/ that end in .log. So I've created a /var/log/myapp/*.log { daily create 644 rotate 90 compress missingok } And this works perfectly well. I ...
-3
votes
1answer
25 views

Daily logrotate doesn't keep the old logs

On a CentOS 6.x I created a simple service called logtraffic which, when started, appends the output of a tcpdump command to a log file at /var/log/logtraffic/logtraffic.log. I want to achieve the ...
0
votes
2answers
67 views

Logrotate not rotating

I have set new conf for logrotate, but I just couldn't get it working. Here's my logrotate: /home/deployer/abc/shared/log/*.log { daily missingok rotate 30 compress delaycompress size 5M ...
1
vote
0answers
40 views

Cron not logrotating for cron.daily

I'm running a rhel7 server and I have a rsyslog logrotate config file that doesn't seem to run using cron job. It will only work if i run it manually Troubleshooting steps i took: logrotate -df /etc/...
0
votes
0answers
29 views

Odoo: reopen log files for external logrotate

We'd like to use logrotate (the standard tool, not Odoo's configuration parameter) to manage rotation of odoo.log: that usually means having the application close and reopen its log file in order to ...
0
votes
1answer
58 views

How to compress and remove olde compressed files using logrotate when the file has a date in its name?

I'm generating files daily named as my_file_YYYYMMDD.csv (for instance, my_file_20160406.csv, my_file_20160407.csv and so on). I want logrotate to compress them daily and that it keep just the last ...
0
votes
2answers
64 views

Apache2 logs are not rotating

My apache log files on my Ubuntu 14.04 machine in the /var/log/apache2/ do not seem to be rotating. I had this problem in the past and had to manually rotate the log file, but it looks like it still ...
0
votes
1answer
112 views

systemd, logrotate and PID-files

I'm packaging some daemon for debian 8 and systemd. The daemon can create PID-file by itself, but it has no permissions to write into /run because of non-root user. It used to create PID-file via old ...
1
vote
0answers
112 views

logrotate as non-root user for files with various owners

I have a collection of log files with various owners. Each log file corresponds to one of a suite of programs, and the permissions are group writable so that whoever starts the program(s) can write to ...
1
vote
1answer
42 views

Why doesn't logrotate's filename globbing pick up files with spaces in their names?

If I specify *bar* {} logrotate will match foo-bar.log but not foo bar.log. From what I have read, logrotate's globbing should behave like shell globbing, so to test I have run ls *bar*. However, ...
1
vote
2answers
447 views

Daily logrotate error creating unique temp file: Permission denied

I have a CentOS 6.7 box that for some reason fails to rotate logs daily. I'm getting an e-mail similar to this one every day in /var/mail/root: To: root@server.nl Content-Type: text/plain; charset="...
-1
votes
1answer
73 views

rsyslog limit log size

Is this even possible to do in rsyslog? http://www.rsyslog.com/doc/rsyslog_conf_output.html This syntax is not working: mail.* -/var/log/mail.log:300M I need to set this limitation ...
0
votes
0answers
20 views

Logrotate does not work daily, but the status file says it does

This is my logrotate script: /var/log/pyApi.log /var/log/runGet*.log { daily missingok rotate 7 compress notifempty nocreate su } Already checked /var/lib/logrotate/...
2
votes
2answers
85 views

nginx logs just failed weekly rotate, how do I determine why?

After I installed nginx, its logs have been rotating weekly as per a weekly cron job on Sunday 00:00 However this week the logs failed to rotate, and I can't figure out why. The only thing I can ...
1
vote
1answer
46 views

logrotate frequency - when and from when

if have lograte in my daily cron /etc/cron.daily/logrotate -- assume cron.daily is run at 1.05am daily and if my logrotate config has a weekly settings Does it means that my logrotate will ...
0
votes
2answers
142 views

Mongodb log rotation creates an extra empty log file each time it runs

I configured a new mongodb arbiter recently, and used this to test some new mongo config, using the mongo 3 config syntax, at the same time I tested log rotation on the server. This worked nicely: $ ...
6
votes
2answers
129 views

Error with gunzip during logrotate

I'm using logrotate to rotate my Symfony2 logs on my webserver. Everything works fine, but I wanted the old logs to be sent to me by emails. So, I added some line in my logrotate conf file as you can ...
0
votes
2answers
36 views

logrotate issue with date appending

I have an Apache server (2.2) running in RHEL 6.3, with the following logrotate configuration: # Rule for Apache logs /var/opt/apache/logs/*log { compress missingok notifempty daily ...
0
votes
1answer
34 views

postrotate script is not receiving rotated file name

I'm trying to do some processing on an exim log, but my script is not receiving the rotated log file name as a parameter - rather, it's getting the original log file name (which no longer exists) /...
-1
votes
2answers
71 views

Logrotate not run [duplicate]

I use ubuntu 14.04 I try to run logrotate each 10min and remove all logs files bigger then 2MB, I try a lot solution but nothing not work, my logrotate run just 1 per day, I try solution with moved ...
3
votes
1answer
56 views

SELinux allow access for perl script via log rotate

I have a perl script that I want to run as a perorate script for log rotate. When I force log rotate to run from the command line as root, it works. However, when run through cron, SELinux prevents ...
0
votes
1answer
20 views

logrotate saves content to old file

I used logrotate to rotate my log files. The conf file look like this: /data/log/web/12114.log { daily rotate 10 copytruncate } But logrotate doesn't cut the log file properly. The ...
1
vote
1answer
74 views

logrotate - run the postrotate after all processing

I have a logrotate script that is structured to rotate logs collected by syslog. Part of that script is to reload the syslog process. The problem is that the syslog reload runs for each matching log ...
1
vote
1answer
156 views

Logrotate running according to cron, but logs are not rotated

I run logrotate through cron with the script [alex@leia ~]$ cat /etc/cron.daily/logrotate #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf >/dev/null EXITVALUE=$? if [ $EXITVALUE != 0 ]; then ...
0
votes
1answer
22 views

Clearing cached memory of uploaded file

On my system, I have a log file that is being rotated and uploaded every hour. This file is heavy on writes and only needs to be read when rotated and uploaded. The cached memory on my system is ...
0
votes
0answers
8 views

logrotate: missingok-equivalent for include directive

Suppose I have something like the following include /path/to/site_logrotate_config in a logrotate config file that should be the same for several hosts. This works fine as long as there is always ...
-2
votes
1answer
77 views

log files become to big

i use ubuntu 14.04 each 2 day i need manualy remove log files from: /var/log/apache2/domains 2 files become to big about 5gb, i found solution, edit logrotate.conf found in etc/logrotate.conf this ...
1
vote
0answers
77 views

logrotate causes php5-fpm downtime

I've noticed that one of our servers starts returning errors just after logrotate runs, i.e. in nginx error log I can see: [error] 8501#0: *118126869 recv() failed (104: Connection reset by peer)...
2
votes
1answer
48 views

logrotate says it's running but it's not

I have just set this box up as a log server so I can forward to a SIEM but the file is not rotating the way I expect. /var/log/remote/*.log { daily dateext rotate 4 compress ...
0
votes
1answer
181 views

Logrotate does not work as expected

Default logrotate rules for httpd in my CentOS 6 installation looks like this: [root@myVM ~]# cat /etc/logrotate.d/httpd /var/log/httpd/*log { missingok notifempty sharedscripts ...
2
votes
2answers
89 views

Split large Logfile with Suffix like from logrotate

after I've seen that I forgot to add a logrotate-conf for php5-fpm.log on one Server, and now seeing that it has grown REALLY big, I'm asking myself how to split this Logfile into separate ones, with ...
0
votes
2answers
337 views

Centos logrotate found error, skipping

One of our servers has a access_log which is nearly 5GB in size - there is currently no log rotation so I enabled it yesterday for httpd The contents of /etc/logrotate.d/httpd is /var/log/*.log { ...
3
votes
1answer
181 views

Unable to enable custom SELinux rule

logrotate is unable to rotate a log file for our application on CentOS 7. This appears to be because of this AVC error: type=AVC msg=audit(1441112694.305:19502): avc: denied { write } for pid=9146 ...
0
votes
0answers
229 views

Where does elasticsearch store graylog2 logs?

I've setup fluentd to stream docker container logs to a centralized graylog2 server. I'm hoping to setup log rotate for these logs. From what I understand, graylog stores these logs in elasticsearch,...
1
vote
3answers
639 views

Apache daily logrotate

I want to create daily logs, but there's a small problem. Logs aren't being created for each day, rather they contain the previous log files. Here's my current setup, how can I change it so it only ...
0
votes
1answer
28 views

Extend “system” logrotate rules without overwriting the package's definition

The package manager installs a logrotate config file under /etc/logrotate.d for Apache2, which contains a create 640 root adm line. I want this to be a bit more liberate, e.g. create 644 root adm. I ...
1
vote
1answer
166 views

Logrotate script not uploading to s3

I am trying to use logrotate to upload log files from my rails and nginx commands once a day. When I run the logrotate command manually the files successfully upload, but it never does it on its own. ...
2
votes
1answer
91 views

logrotate compression parameters

I've been using cstream for a while for many things, for example to reduce the impact that mysqldump has on drives. However, I have always done so by calling the binary directly from a script or ...
0
votes
2answers
57 views

logrotate not workig as expected

I am setting up logrotate & realized that a few of the options are either incorrectly explained/understood. My logrotate rotate 52 keyword is creating 52 files of the same log every time it ...
1
vote
2answers
1k views

Delete files with logrotate

Is it possible JUST to delete the log files in a directory by using logrotate w/o actually rotating them? We have an app that generates logs in the following format: app.log.DD_MM_YYYY. I am ...
0
votes
1answer
254 views

Syslog logging to syslog.1 not syslog

My syslog file is getting a bit unmanageable. I believed I had configured this previously to rotate daily but obviously something has gone amiss. At the moment, my /var/log looks like this: -rw-r----...
0
votes
3answers
287 views

How to make a cron script for cleaning up a log file? [closed]

I don't usually do this kind of stuff, so I just have to ask. How do I make a script which checks a log file, lets say it's named log.txt, grabs everything but the first 100 000 lines from it to a new ...
2
votes
1answer
638 views

How to rotate a log file from crontab?

I have this directive on my crontab: * * * * * /var/www/github/mysite/bin/email email worker await --pid=/var/run/mysite-worker-email.pid >> /tmp/mysite-worker-email.log As you can see all my ...
1
vote
1answer
67 views

Logrotate deleting instead of rotating

This is my logrotate configuration /var/log/abc/*.log { missingok compress sharedscripts create 640 root root postrotate /etc/init.d/abc reload endscript } When i run this manually as logrotate /...
0
votes
1answer
59 views

Issue with logrotate log based on an interval unless log exceeds a certain size?

I went though few resources in this forum like: How to rotate log based on an interval unless log exceeds a certain size? but, I don't see my log files being rotated daily. their max size for past ...
0
votes
1answer
112 views

How to filter cron messages in syslog-ng

I have a litte problem. I dont know ho to filter cron jobs in syslog-ng. It's spamming my log. Jun 05 16:09:01 CRON: pam_unix(cron:session): session opened for user root by (uid=0) Jun 05 16:09:...
0
votes
1answer
763 views

auditd process stops logging after logrotate script runs

I am trying to use logrotate to keep audit logs for a set period of time rather than using auditd's special rotation (from /etc/audit/auditd.conf). I have changed the max_log_file_action to IGNORE in ...
0
votes
1answer
152 views

Logrotate - how change it so that it never deletes logs and will create a .gz every 6 months?

I read the man logrotate, but it's still unclear to me. My questions are mainly related to the NGINX webserver logs. This is my current logrotate.conf: # rotate log files weekly weekly # keep 4 ...