The tag has no wiki summary.

learn more… | top users | synonyms

32
votes
1answer
4k views

How to do a `tail -f` of log rotated files?

On a long running system I usually have a terminal with $ tail -f /var/log/kern.log or something like this open. But from time to time I have to restart such command because no new messages are ...
16
votes
5answers
1k views

Is there a tool that combines zcat and cat transparently?

When handling log files, some end up as gzipped files thanks to logrotate and others not. So when you try something like this: $ zcat * you end up with a command line like zcat xyz.log xyz.log.1 ...
14
votes
1answer
17k views

How can I set up logrotate to rotate logs hourly?

According the the Unix and Linux Administration Handbook and man, logrotate has options for daily, weekly, and monthly, but is there a way to add an hourly option? This blog post mentions you can set ...
13
votes
2answers
12k views

Logrotate: “log does not need rotating” why?

I have the following new logrotate configuration: /var/log/nexus/nexus.log { rotate 7 missingok compress delaycompress copytruncate daily } When I run logrotate -d nexus, I ...
11
votes
2answers
10k views

How to avoid apache reload when rotating logs?

I use logrotate to rotate Apache access-, error- and rewrite-logs. My config file looks like this: /apache/*log { compress dateext rotate 365 size=+300M olddir /log/old/apache ...
9
votes
5answers
5k views

Keep log file size fixed without logrotate

Is there any way to keep file size of log file fixed without rotating it by a new empty file and deleting (or archiving) the old file. For example, if I set log file maximum size to 1MB, after the ...
8
votes
1answer
13k views

why we should use create and copytruncate together?

thegeekstuff has an example about logrotate. copytruncate will copy and truncate the original log file. Then why we should use create? The original log file has not been removed. /tmp/output.log { ...
5
votes
1answer
105 views

Rotating log files while process still running

I have a process running that writes standard output and standard error to a log file /var/log/dragonturtle.log. Is there anyway to rotate the log file, and have the process continuing to write to the ...
5
votes
3answers
2k views

logrotate doesn't work for munin after last update on OpenSUSE 11.4

I'm using munin 1.4.5 on OpenSUSE 11.4. Lately logrotate was updated to fix some permission problems and after that complained with Mar 3 12:15:05 lucien logrotate: error: "/var/log/munin" has ...
4
votes
3answers
6k views

Can I use logrotate to compress daily (date named) logs?

I have logs in the following format: YYYYMMDD I want to compress old logs (older then current day) and maybe move them to a different directory afterwards. Can I do this in logrotate, or do I have ...
4
votes
1answer
2k views

learning about general logging/logrotation on linux?

Assume, that beside the Apache web server logs I never had any contact with any kind of (professional) logs on any operation system. So Logging, although I understand some basics, is all together a ...
4
votes
1answer
77 views

Keeping copies of the X log file on Debian

I recently tried to replace my Nvidia driver with the Nouveau driver for my Nvidia card, (see Switching from Nvidia proprietary driver to Nouveau driver for Nvidia card on Debian wheezy). ...
3
votes
1answer
170 views

“tail -f” show old file after file has been rotated [duplicate]

I have a script running continuously, reading tail -f /var/log/daemon.log The problem is, when the file /var/log/daemon.log gets rotated by logrotate, tail still has "file handle" for the old ...
3
votes
2answers
354 views

Does /var keep growing in size?

tldp.org quotes /var as: Files in /var/log can often grow indefinitely, and may require cleaning at regular intervals. So without cleaning, using a system for a long enough period will fill up ...
3
votes
1answer
710 views

Logrotate maually on FreeBSD 8

I am able to rotate any log file manually via logroatate like this: logrotate -f /etc/logrotate.d/my-hourly-file I want to know how to perform the same action on FreeBSD 8? My investigation shows ...
3
votes
1answer
719 views

Does setting the system time back impair logrotate operation?

I'm working on an embedded linux system where the root filesystem is mounted from an SDcard. Although many systems like this just mount /var/log on a ramdisk, I'd like to save the logs to the SDcard ...
2
votes
3answers
2k views

How to make log-rotate change take effect

I followed this link to change log-rotate configuration. https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-logfiles-locating.html After I made the ...
2
votes
3answers
503 views

Rotating logs generated from tcpdump with logrotate

On one production linux box, I am capturing SIP packets using the following configuration: logrotate.conf: # Opensips SIP traces /var/log/sip.log { rotate 31 daily missingok ...
2
votes
3answers
810 views

Advanced logrotate on huge number of files when single instance of logrotate cannot keep up

I'm managing a server which works as a remote log repository for huge number of files. Currently a single logrotate instance cannot keep up with this number of logs. What's the best way to accelerate ...
2
votes
3answers
802 views

solution to rotate log files

I am running a daemon process that will have to run indefinitely (a 'service' so to speak) and wish to log its output. A simple solution like: ./long-running-process > log.out & ... fails as ...
2
votes
3answers
3k views

Logrotate not truncating open file

I have a system that is acting simultaneously as a test and demo platform. I'm recording a massive amount of data output by my systems that I wouldn't be recording when this is in deployment and ...
2
votes
2answers
538 views

Logrotate doesnt start proftpd triggerd by cronjob

Im currently running of ideas. The proftpd doesn't restart, if logrotate is triggered by the cron task. Logrotate rotates all logfiles stops proftpd but does not start proftpd again. If i force the ...
2
votes
1answer
442 views

Periodically get new lines from file, possibly logrotated

I'm looking for a fairly simple way (no development involved -- I could write this in Python but I'm hoping there's something already out there). I have a log file (in my case written by rsyslogd). ...
2
votes
2answers
1k views

How does logrotate treat globbing?

If I have a logrotate config file like this, # matches multiple ones /var/log/project/*.log { ... prerotate ... endscript ... } So how does the glob work here? If I have 3 log ...
2
votes
1answer
24 views

appendable and greppable archive on CentOS to hold many log files (logrotate on steroids)

I have a bunch of applications on a CentOS 6.3 box, which generate daily logs (text files with a very similar content) in this vein: /data/logs/app/my-2014-06-29.log ...
2
votes
1answer
2k views

Sarg report error

I have a proxy server that runs Ubuntu Server 11.10, Squid 2.7.STABLE9. I installed sarg (version 2.3.1 Sep-18-2010) to generate reports using the ordinary apt-get install, and added a cron job to ...
2
votes
1answer
147 views

using logrorate with a complex logging directory

An application has a log directory, in which a alot of log output is created. The file structure in this log directory looks something like this: localhost:/var/log/myapp # ls appClient22334.a ...
2
votes
1answer
119 views

Missing entries from messages file

I have a CentOS server that has been working well until recently. The virtualized instance of the server encountered some type of issue earlier today and required it to be hard rebooted in order for ...
2
votes
3answers
819 views

Is there a way to tell logrotate to ignore open files?

I've searched a bit and can't find anything. I don't want logrotateto touch files that are currently open. I was thinking of doing something with lsof but I didn't see a way to get any of the scripts ...
2
votes
0answers
177 views

Logwatch ignores self-defined service, but explicit setting --service $service works

I am using SSLH on my server to accept both SSL and SSH connections on Port 443. As the logs of sshd and apache2 show each incoming connection via SSLH originating from 127.0.0.1, I want to add the ...
1
vote
1answer
93 views

log rotate, why creating a fresh log is called log rotate instead of log delete or log refresh

Why creating a fresh log file is called log rotate instead of log refresh or log delete? What does the word rotate emphasis?
1
vote
2answers
723 views

squid access.log delete entries older than 6 months

Squid generates a log of the accessed sites by the users. I want to delete the entries in the /var/squid/logs/access.log, which are older than 6 months. I would execute the script each week. I have ...
1
vote
1answer
316 views

logrotate won't truncate original file

I have this conf for my logrotate: /tmp/snmp.log { daily rotate 12 missingok notifempty copytruncate dateext } but it won't truncate the original file. it logrotates but ...
1
vote
1answer
3k views

How to properly automatically/manually rotate log files for production Rails App

I am taking over administration for a server which has a custom made 3rd party Rails app. The app developer informed me that the ruby log files are getting large and pointed me to the following link: ...
1
vote
1answer
73 views

Logrotate behaving unexpectedly

Find below the logrotate configuration that I'm using /usr/local/nagios/var/nagios.log { copytruncate daily rotate 7 compress missingok size 100M } And I could notice that ...
1
vote
1answer
514 views

Error stat of log failed: Permission denied during LogRotation

After installing a new CentOS 6.0 server, logrotate was working absolutely fine. Then one day due to a kernel panic, the server had to be hard booted, and ever since log rotation is not rotating the ...
1
vote
1answer
450 views

How can I learn some advanced logrotate techniques?

The logrotate section in the Linux administrator's handbook is very brief. The man page is ok but lacks examples. Where can I find some more comprehensive information, examples, and best-practice ...
1
vote
3answers
414 views

Script or tool for maintenance (archive/remove old files, clean temporal files, etc…) on Unix/Linux

Everybody have the same problem: How to deal with old files, logs, temporal files to archive them (compress, store in alternate locations), delete unneeded, etc. them Specially if you have to deal ...
1
vote
1answer
2k views

How to make sendmail write to new maillog

I want to rotate my maillog, but I want to make sure the newly rotated log contains the last 2M lines from the previous log: # write the last 2M lines to a new log tail -n 2000000 ...
1
vote
1answer
101 views

logrotate unable to rotate logs

logrotate is unable to rotate my logs. I have checked the file permissions, they are fine. I have even tried by putting "su root root" in the configuration file, still I am facing the same issue. ...
1
vote
1answer
1k views

Activity Logging Level in SFTP

I'm using CentOS, i have already figured out how to enable the SFTP Logging. After that when i test it by using FileZilla (from User-end) and tail -f /var/log/sftp.log from the Server, all the ...
1
vote
1answer
695 views

Daily logRotate for apache at specific time

How can I execute logRotate daily at a specific time (3h30) each day? Specific details on how to do this would be appreciated. I'm on Debian.
1
vote
1answer
3k views

How to remove obsoleted logs with logrotate?

I wanted to remove unnecessary logs automatically , like Xorg.log.0 , and other packed *.gz files , i really don't need that on a laptop system. However , i checked man logrotate , but only an entry ...
1
vote
0answers
55 views

Logrotate no longer reads symlinked configuration file due to non-root ownership

We are currently upgrading from Ubuntu 12.04 LTS to 14.04 LTS on our ruby on rails application servers, and have noticed that the log files are no longer rotating. On both machines we have a file ...
1
vote
0answers
175 views

Permission denied when running logrotate with anacron

I am trying to figure out what is causing anacron to send me the following error message: /etc/cron.daily/logrotate: /var/log/mariadb/mariadb.log-20140710.gz: Permission denied error: error running ...
1
vote
0answers
106 views

logrotate error “error: error opening /home/web/logs/dev.log.10: No such file or directory”

In a run, sometimes I get such type of errors for any of the log file. Below is my configuration: /home/web/logs/*.log.* { missingok copytruncate olddir rotate rotate 5000 compress ...
1
vote
1answer
175 views

Logrotate not picking up or acting on new configuration file

I had a logrotate configuration file set up for a log (let's call it Log1). It is working fine and the log is rotating everyday as expected. Yesterday I cloned this set up and modified it for three ...
1
vote
1answer
163 views

logrotate custom “rotate” action equivalent for upstart?

In lots of online posts regarding how to rotate your iptables log files, for example here rsyslog config files get reloaded by the postrotate option of logrotate, presumably in order to stop rsyslog ...
1
vote
1answer
215 views

Rotating iptables logs, strange message about script being converted to upstart job

I use a script /etc/logrotate.d/iptables containing entries like: /var/log/in_iptables.log { rotate 4 weekly missingok notifempty compress ...
0
votes
2answers
151 views

How to manage all logs on VPS

I'm new to Linux but I'm about to start using a VPS to host my website. I've been reading about and it's been mentioned that I need to make sure that all of my logs are rotating and compressed, but I ...