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

3
votes
2answers
517 views

Why auth.log gets rotated multiple times every day?

I noticed a suspicious behaviour of my auth.log. For some reason it is getting rotated multiple times everytime it should rotate. 2014-06-15 06:25:06,102 fail2ban.filter : INFO Log rotation ...
1
vote
2answers
146 views

Apache logrotate with different names for current and archives

I'm running Apache 2.2 on CentOS 6.5 and what I'd like to do is have Apache's current access log file be: /var/log/httpd/access_log And each day at midnight, that file is renamed like so (assume ...
2
votes
1answer
827 views

How backup files with logrotate and Amazon S3?

I would like to create a new standard of two things: how long would be generated and be rotated the logs generated by my applications ? how to transfer the logs to Amazon S3, as a backup server ?. ...
2
votes
1answer
820 views

logrotate not deleting old files - glob failing

I'm stumped with this one. Any help is much appreciated...! Logs in /var/log/HOSTS/cacheflow_access_log/ are configured to archive to /var/log/HOSTS/archived/cacheflow_access_log/ and compress. These ...
2
votes
1answer
253 views

logrotate> removing delaycompress function: should I compress the last log myself?

I'm removing the delaycompress function from my logrotating script. Before running logrotate again, should I compress the last log myself ? This is the actual situation: -rw-r----- 1 root adm 4,7M ...
1
vote
1answer
35 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
1answer
61 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
332 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 he/...
1
vote
1answer
42 views

Rotatelogs not functioning

My system is Debian with Apache 2.22 I'm trying to rotate my logs with rotatelogs. The format in the logfile works but the rotation is not working. Part of the apache2.conf LogFormat "%h %t %m %U %...
1
vote
1answer
637 views

Logrotate for node.js app deployed using monit and upstart

I deployed a web application in node.js by following the guide: Deploying Node.js With Upstart and Monit . The app produces some log via console.log(). In the upstart script, it's redirected to a log ...
1
vote
1answer
721 views

Debugging logrotate postrotate script

Following is my logrotate conf. /mnt/je/logs/apache/jesites/web/*.log" { missingok rotate 0 size 5M copytruncate notifempty sharedscripts ...
1
vote
1answer
309 views

Logrotate rotating daily but should be rotating weekly

For some reason logrotate is rotating logs daily instead of weekly, even though all the config files for logrotate seem to be set to weekly. Any ideas? /etc/cron.daily/logrotate #!/bin/sh test -x /...
1
vote
1answer
59 views

logrotate : Contents are missing

I'm using logrotate to rotate my log file periodically (in my case every 1 hour checking for log file size and rotate if needed using cron). I'm facing a serious issue in it. The following files ...
1
vote
1answer
442 views

How to make logrotate keep the last week into the current .log

Is it possible to get logrotate to keep the last week of logs in the current file? for example : errors.log contains 30 days of logs after log rotate executes , I would have : errors.log with ...
1
vote
1answer
684 views

Apache, logerror and logrotate: what is the best method?

Here's a vhost example of my sites: <VirtualHost *:80> DocumentRoot /datas/web/woog ServerName woog.com ServerAlias www.woog.com ErrorLog "|/httpd-2.2.8/bin/rotatelogs /logs/...
0
votes
1answer
56 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
1answer
41 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
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) /...
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 ...
0
votes
1answer
217 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
1answer
109 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
689 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
207 views

Syslog-ng and Logrotate creating sparse files

We've been using syslog-ng to log our postgres logs. On top of it we run logrotate every 5 minutes which also gzips the files. Recently, we've noted that these postgres logs contain a lot of null ...
0
votes
1answer
49 views

Configure logrotate to shrink file in user's folder?

All my users in /home/{user}/ have a specific error_log file in it that may grow overtime. So I was thinking about using logrotate to implement some kind of file reducing on it : when the file ...
0
votes
1answer
356 views

Linux cp with gzip and numbered backup in one step?

I'm wanting to copy a file and gzip it in a single command/step But I want to do numbered backup if the file already exists i.e. "cp --backup=numbered" or similar. The reason for the single step is ...
0
votes
1answer
707 views

Debian cron complaining about log dir ownership since upgrade to Wheezy

I'm getting errors from cron like this: /etc/cron.daily/logrotate: error: skipping "/var/log/apache2/access.log" because parent directory has insecure permissions (It's world writable or ...
0
votes
1answer
540 views

using logrotate with prerotate/postrotate scripts

I need to deliver csv file with some data which will come from my application. Structure of file shall look like this: time,time,meas_type,meas_val[1],meas_val[2],meas_val[3] 1379501121,1379501121,...
0
votes
1answer
327 views

Best way to rotate Magento logs?

We have a lot of sites on Magento and the logs are getting gigantic, so I'm wondering if the best way is to use a cron script to rotate them or logrotate. I want to avoid making file copies as it ...
0
votes
1answer
357 views

MySQL replication & logrotate

I'm using MySQL Master-Slave replication for backup purposes (for a few days). Today after changing to expire_logs_days = 3 on master and slave I got this message (from slave): /etc/cron.daily/...
0
votes
1answer
379 views

Hosts.deny file not being updated by denyhost service

I have denyhosts running on my server to block IPs that repeated fail to login over ssh, for example brute force style attacks. I can see that entries in the auth.log file have not been updated in the ...
0
votes
1answer
725 views

logrotate deletes all maillogs older than one day

I see only two files maillog and maillog.1 in /var/log. grepping for maillog in logrotate.d directory gives three files that have a mention of maillog. syslog /var/log/messages /var/log/secure /var/...
0
votes
1answer
389 views

Memcached logrotate file not being installed. Bug with memcached 1.4.2?

My memcached logs are getting huge (in excess of 5GB). This isn't a huge problem in itself. I can easily remove them. I've sourced the problem to the memcached 1.4.2 package not installing a ...
0
votes
1answer
212 views

Apache, and logrotate instances

If I have one website and I want to rotate its logs, there's one instance of logrotate that is launched. There are as many logrotate instances launched as they are virtual websites. Here you can find ...
-1
votes
1answer
104 views

Yesterday-access.log is pointing to a different directory

Under /var/log/ispconfig/httpd/quotednews.com/ folder, the yesterday-access.log is pointing to a wrong directory. yesterday-access.log is just a symlink to: /var/www/clients/client1/web2/log/20130626-...
2
votes
0answers
122 views

Logrotate directories (not files)

I have an application creating logfiles in a structure like this: maillog/ 2012-07-02/ production_environment-2012-07-02__23_51_50-1341265910-some name.log production_environment-2012-07-...
1
vote
0answers
38 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/...
1
vote
0answers
76 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
0answers
70 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)...
1
vote
0answers
125 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
87 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 ...
1
vote
0answers
129 views

Postrotate “error running shared script”

Morning all, I realise this question has been answered already but the fix does not seem to work in this case so I'm hoping you guys can help. This this is the error I'm getting: error: error ...
1
vote
0answers
317 views

How to configure logrotate to just prune a directory once a week?

How to configure logrotate to just delete all files under selected directory once a week? I'm testing the following: /var/spool/mydir/* { daily rotate 0 nocompress copytruncate } ...
0
votes
0answers
20 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
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/...
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 ...
0
votes
0answers
207 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,...
0
votes
0answers
91 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
0answers
368 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
0answers
179 views

Apache logging: Are there any alternatives to piped logging that allow for automatic compression?

Are there any alternatives to Apache's rotatelog that will also compress logs? Logrotate is not an option due to requiring a restart. Ideally this would be a utility that can be used to pipe logs from ...
0
votes
0answers
570 views

Remove old logrotate entries

Recently I have removed nginx on my server running Debian Linux and since then, I keep getting the following email every day: root@server:~# tail /var/mail/root Content-Type: text/plain; charset=UTF-...