Tagged Questions

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
44 views

specify multiple filenames in one line. bash

guys. im trying to add to logrotate files from a some directory. it should be either *.txt files or *_log files. wtat's the right syntax for this: /var/www/html/groupware/horde_logs/[*.txt|*_log]{ ...
-2
votes
1answer
107 views

CentOS 6.3: logrotate and btmp

I had to configure logrotate on a server configured by other system-network administration. First of all I detected that there is no crond, so I had to install sudo yum install vixie-cron. All other ...
1
vote
1answer
392 views

How to stop logrotate from changing the rotated logs owner

I have a logfile owner by the 'apache' user that I would like to rotate with logrotate. I would like to do that by running logrotate as a different user, say 'web' using the copytruncate strategy. ...
1
vote
2answers
901 views

Mongodb - proper way to rotate logs

Mongo docs say that I can: use -SIGUSR1 signal and get the old log renamed and current switched use logrotate from OS I want the OS's logrotate ability to zip old files and remove oldest, but see ...
0
votes
1answer
324 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] ...
0
votes
1answer
163 views

Disk usage of Puppet reports

We are running puppet-dashboard on the puppetmaster which processes all the reports and puts them in a MySQL table. Every month about 5GB of reports are generated however in /var/lib/puppet/reports. ...
0
votes
1answer
111 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
285 views

Daily queries log file

Has MySQL a daily log rotation system? like Apache that creates daily log files? I'm having a very hard time to find any good info about this. Win Server 2008 R2 MySQL 5.1.11 I'm logging all ...
-1
votes
2answers
461 views

Apache vhost log rotate by date

I've got Apache 2.2 running on Debian 7 (on a VPS), with virtual hosts defined for several different websites. I've set up individual error and access logs for each vhost, but I've not found a way to ...
2
votes
3answers
248 views

How does logrotate interact with hard linked files?

I have a service which insists on keeping it's log files in terrible locations. After all efforts to change where it keeps them failed, my next idea was to create hardlinks to those files somewhere ...
0
votes
1answer
53 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: ...
1
vote
1answer
389 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 ...
2
votes
1answer
236 views

unix logrotate specify chunk size

How can I specify output file size which I want after rotation? For example lets say I want to run logrotate when log file reaches 10MB and I want to split this log into chunks which are 1MB max. I ...
0
votes
0answers
167 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): ...
0
votes
1answer
65 views

logrotate — moving logs by size

I want to move all logs bigger than 1M to "olddir" (/var/log/old in this case). I've googled and read the manpages, but haven't found a satisfactory solution.
0
votes
2answers
213 views

Null bytes in a file created by 2> rotated with logrotate?

I'm using the script utility to record terminal sessions, and using logrotate (with copytruncate, script ignores HUP and keeps writing to the rotated file otherwise) to periodically upload chunks of ...
-3
votes
2answers
1k views

Logrotate error for fail2ban

I get the following error when running a cron job, and I'm not too sure how to go about fixing. This is on Ubuntu 12.04 LTS. test -x /usr/sbin/anacron || ( cd / && run-parts --report ...
1
vote
1answer
350 views

Append date to domain logs with logrotate in Plesk 11

I am using plesk with a Media Temple DV 4.0 Account. It has a GUI to set up log rotation for my domains. However I need to append a date/time stamp to the logs so our stats software importer can ...
2
votes
1answer
340 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
529 views

logrotate cron job not rotating certain logs

I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext ...
0
votes
1answer
149 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
234 views

Does fail2ban monitor rotated log files?

Does fail2ban continue to monitor rotated log files? For example, I have a rule monitoring /var/log/fail2ban.log which is automatically rotated by the system every week (7 days). I want to have a ...
2
votes
1answer
69 views

logrotate compress files as a different user than specified

Using the following logrotate config file, rotated files are being chowned to the specified user but not compressed ones. /var/log/file.log { notifempty missingok ...
0
votes
1answer
465 views

How should I rotate rsyslog documents stored in mysql

I have setup rsyslog to dump syslog data into mysql so that LogAnalyzer can easily access and interact with it. How do I automate a job to remove syslog data of a certain age for the mysql database ...
0
votes
3answers
1k views

Why is logrotate not rotating logs Tomcat access logs on aws centos 6.3?

I have the following file in /etc/logrotate.d: /usr/share/apache-tomcat/logs/*.access { nodateext copytruncate daily rotate 7 notifempty postrotate EXT=`date --date='-1 day' +%Y-%m-%d` /bin/gzip $1.1 ...
3
votes
1answer
2k views

Logrotate not rotating file after file size exceeds the limit.

From logrotate manpage. It will not modify a log more than once in one day unless the criterion for that log is based on the log's size According to the man page, logrotate should ...
7
votes
1answer
2k views

How to rotate log based on an interval unless log exceeds a certain size?

From the man page of logrotate: minsize size Log files are rotated when they grow bigger than size bytes, but not before the additionally specified time interval (daily, weekly, monthly, ...
1
vote
0answers
1k views

Logrotate doesn't work from cron on CentOS

I have lograotate configured on CentOS 6. It works fine when I run it manually, but with CRON it doesn't work. Cron says in its logs: "All fine, I run you command" but nothing happens. Details: cat ...
0
votes
1answer
3k views

Logrotate: rotate all log files on specific size and rotate hourly

My logrotate file on ubuntu runs daily. I want to make sure its rotating log files in every hour to get no full disk error anymore. So my logrotate file is in the cron.daily folder, is it enough to ...
1
vote
1answer
106 views

logrotate daily directive ignored

For logrotate I have a cron task that runs hourly. In logrotate.conf there's the directive "daily". But the log files are rotated hourly, not daily. Why does it happen? What's this directive for? I ...
0
votes
1answer
39 views

Logrotate Creating Empty Rotated Files

I have the following parameters set up for the log rotation of a log. size=10M, rotate 800, copytruncate, missingok. 800 rotated files are being created, but many of them are below 10M and some of ...
1
vote
1answer
84 views

In logrotate, where does postrotate log errors?

If there are errors in the postrotate script block, where are they logged in Ubuntu?
3
votes
1answer
375 views

rotating logs with logrotate

I want to schedule logs rotate with these rules: log files for the last 2 day are kept untouched log files older than 2 days are archived and moved to folder named by date, they were created. (For ...
2
votes
3answers
3k views

Why does my CentOS logrotate run at random times?

I put a logrotate configuration file in /etc/logrotate.d/ and expected the logs to rotate at a consistent time; however, they do not... log rotation times are seemingly random +/- one hour. Why are ...
0
votes
1answer
184 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
189 views

What actually calls logrotate in CentOS 6.3

What actually calls logrotate in CentOS 6.3? I looked inside of /etc/init.d but nothing related to logrotate there. Also, nothing in the crontab for the root user. Thanks.
4
votes
1answer
717 views

Rotating logs generated by a process that logs to stdin

I have a long running process, that writes its log file to stdout. I would like to save this output to different files, automatically maintain these files (like deleting/archiving the old ones), ...
1
vote
1answer
1k views

PHP-FPM signals for pool error_log rotation

I am moving all my server's log rotation tasks for logrotate. The server has several PHP-FPM pools, each of them configured with a separated error_log directive. The logrotate recipe for the logs is ...
0
votes
2answers
58 views

Logrotater Daily situation

Every day I would like to run logrotate on /var/trafficap/captured/arch/ and zip all the zip packages I have for each day ( its 1 package.zip with a name like this : ...
1
vote
1answer
1k views

Rotating Iptables logs with logrotate

I'm running CentOS6 and I configured rsyslog to monitor my iptables warning messages and dump them in /var/log/iptables.log. I went through my logrotate.d/syslog file and added iptables.log so ...
1
vote
1answer
200 views

Linux logrotate offset delay

I have servers with huge daily size of log files ~ 1GB. I want to do daily logrotate at midnight. The problem is for each rotated file missing first 17-25 minutes after midnight and same file ...
8
votes
1answer
2k views

How can I rotate many log files into a different subdirectory per rotation?

I have a directory with many log files, all of which I would like to rotate daily. For organizational purposes I would like to be able to move the rotated logs into a different directory (or ...
1
vote
1answer
50 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 ...
2
votes
4answers
518 views

How important is it to keep size of log files down?

I have a LAMP server where logrotate does its job once per week, and I notice some logs tend to get quite large. For example, the apache access-log is 73MB. Is it better that I tell logrotate to ...
0
votes
2answers
58 views

Logrotate, is this a proper config for what I want to do?

I started using logrotate a few days ago on a new server setup (actually three of them). My config is as follows. /var/www/mywebsite.com/logs/*.log { rotate 14 daily dateext compress ...
2
votes
1answer
2k views

How can I get logrotate dateext to reflect the log date rather than the rotation date?

My Apache logrotate config looks like this: /var/log/http/*log { monthly dateext dateformat .%Y.%m [... rest stripped for brevity ...] } This works great, except that the date on ...
1
vote
0answers
276 views

Windows Apache logrotate.conf equivalent for rotatelogs.exe to overwrite logs

Our disk is getting full real fast on Windows with Apache Logs.I want to overwrite old log files so that there are only 10 files at any 1 time with a capacity of 5M each. Is there a way to use rotate ...
0
votes
1answer
462 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 ...
0
votes
2answers
246 views

logrotate: keep N newest files, but don't rename

I have a service that automatically creates a log file with a timestamp in the filename on startup. Thus, I don't need logrotate to rename/copy/create files, but what I do want is that logrotate shall ...
4
votes
4answers
2k views

log rotation --Windows

I am looking into log rotation for our web server (not apache) on Windows. I have heard of cronolog, CHOMP, and others. Does Windows have a built-in rotation .exe? What have you found to be a good ...