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

0
votes
0answers
11 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
53 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
52 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
64 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
51 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
33 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
244 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; ...
-1
votes
1answer
47 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
19 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 ...
2
votes
2answers
84 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 ...
0
votes
1answer
40 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
83 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
115 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
30 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
32 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
60 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
49 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
51 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
113 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
67 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
63 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 ...
2
votes
1answer
42 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
125 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
78 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
255 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 { ...
2
votes
1answer
116 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
187 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 ...
1
vote
3answers
518 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
140 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
88 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
49 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
836 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
0answers
87 views

Command with -sigusr1 and kill not restarting gracefully

I have a kill command in my /etc/logrotate.d/php-fpm file: /var/log/php-fpm-5.5.11/*log { missingok notifempty sharedscripts delaycompress postrotate /bin/kill -SIGUSR1 `cat ...
0
votes
1answer
192 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: ...
0
votes
3answers
234 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
377 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
66 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
0answers
351 views

Logrotate: Error creating outfile, file already exists

I run logrotate in a daily cron, today I got an e-mail about a file already existing error: error creating output file path/to/search.log.2014-10-03.1412289722.gz: File exists But I'm not sure why ...
0
votes
1answer
58 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
107 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 ...
0
votes
1answer
637 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
130 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 ...
1
vote
1answer
319 views

Using logrotate to ONLY delete logs that are managed/rotated by another service

There are many programs out there that manage log file rotation by themselves. Many of them however only rotate the log and never delete them, and assume that is just part of the sysadmin's job and ...
1
vote
0answers
114 views

MongoDB Backup & purge

I'm exploring solutions for a basic dbadmin need : periodically backing up and purging data in MongoDB. Basically, I need a logrotate for mongodb. I have a backend program filling a collection. I ...
1
vote
0answers
82 views

Unable to get structured data in logged messages even after adding mmpstrucdata and mmrfc5424addhmac?(RFC5424)

I am trying to log messages with structured data . But it is showing null value for structured data. I am working with rsyslog 8.9.0.Can someone tell me either i need to load some module or modify ...
3
votes
2answers
4k views

rsyslog with logrotate: reload rsyslog vs copytruncate

I'm working on Ubuntu 14 with the default rsyslog and logrotate utility. In the default rsyslog logrotate /etc/logrotate.d/rsyslog config I see the following: /var/log/syslog { rotate 7 ...