Questions tagged [log-rotation]

Log rotation is an automated process used in system administration in which dated log files are archived.

Log rotation is an automated process used in system administration in which dated log files are archived.

66 questions
1
vote
1 answer

Rotating logs with different names with logrotate

The logs name are appended with timestamp when generated like log-20140526-062503.txt Is there a way to manage this? I tried with a custom state file but log rotate does not delete old file. /var/logs/*.txt { rotate…
idris
  • 13
  • 1
  • 4
1
vote
2 answers

Rolling log file without losing any log event

I have a 8GB file called php.log with a running php script logging into it. It is important for me that I log every event, and I want to compress it and empty the current file without stopping the web server. If I run: mv php.log…
Mohammad Jolani
  • 333
  • 1
  • 2
  • 8
1
vote
1 answer

How do I rotate old log files to long-term backup?

I have logrotate set up to archive logs for 30 days; how do I set up my cron job to rotate them automatically from /var/log/net to the long-term storage I have mounted on /mnt/backup? I do not need to mangle the name when I archive…
Mike Pennington
  • 8,266
  • 9
  • 41
  • 86
1
vote
1 answer

logging with named pipes

I have a lot of code I need to daemonize that prints to standard out. I am thinking of using the following shell script to create a named pipe so I can nohup a process while redirecting its output to the pipe. #!/bin/bash ###############3 #…
Hersheezy
  • 356
  • 1
  • 16
1
vote
2 answers

unidentifiable httpd log rotator

I have my own server instance which is centos 5.7 and have installed apache some time ago. Now I noticed that my log files are rotating. I couldn't remember if I had set up something or not since there is nothing on cron, and the error logging on…
voldomazta
  • 113
  • 4
1
vote
0 answers

Is that possible to let "multilog" program output human-readable file name instead of TAI64N timestamp name?

I am using "multilog" to do log rotation in debian server. When the log roates, "multilog" will create a filename as @TAI64N_timestamp.s or @TAI64N_timestamp.u. I know I can convert TAI64N timestamp to human-readable format by using tai64nlocal…
sgon00
  • 143
  • 1
  • 5
1
vote
1 answer

Logrotate docker container's logs when user doesn't exist on host

I mounted my containers' logs to the host (e.g. /var/log/container1, etc). Now I want to use the host's logrotate. But suppose I need to do this: create 660 mysql mysql There is no mysql user/group on the host, so logrotate fails with: unknown…
lonix
  • 757
  • 9
  • 20
1
vote
1 answer

Log Rotate doesn't rotate logs

I have a logrotate running on Aws ec2 instance which is trying to rotate logs under /var/log/tomcat8/ every hour. I have below configuration under /etc/logrotate.d/rotate_tomcat: "/var/log/tomcat8/localhost_access_log.*-*-*.txt"…
krish
  • 13
  • 2
0
votes
1 answer

where is rotation policy of logs under /var/log/messages-*

I would like to know how messages log file /var/log/messages are rotated. I checked in /etc/logrotate.conf file and inside /etc/logrotate.d/ directory but nothing that could explain the rotation. Eg: This is a small part of messages file: Oct 23…
Adil Saju
  • 101
  • 2
0
votes
1 answer

Logrotate Separate Policies in Same Directory

I am running rsyslog on CentOS and logrotate to rotate my logs. All hosts write their logs to /var/log/syslog/ in their own separate directory in this…
Jake
  • 25
  • 2
  • 8
0
votes
0 answers

Does logrotate check diskspace before rotating a logfile?

I am trying to figure out how logrotate work regarding disk space but not able to figure it out? Scenario: Let say I have 2GB of the log file and free disk space is also 2 GB, does logrotate first check do we have a sufficient disk space before…
0
votes
1 answer

Logrotate with `copytruncate` "data loss" - is it serious?

Manpage of logrotate claims that using copytruncate option leads to "a very small time slice between copying the file and truncating it, so some logging data might be lost". Is it actually relevant in real world scenarios? I'm using logrotate…
0
votes
3 answers

Ideal log rotation configuration for overloaded site

I've been in charge of a server that has been stressed beyond its tipping point for some time. I've recommended changes that are currently in the process of being implemented by other members of the team that should alleviate the core infrastructure…
emsoff
  • 103
  • 4
0
votes
1 answer

logrotate when size reaches 10M

Please kindly advise/assist. I want to set up logrotate that does the following: when the log file size reaches 10M,the file is rotated and also there is no keeping of older compressed log files. I have tried the following and its not working…
sawe
  • 1
  • 3
  • 5
0
votes
0 answers

Use `tail` to rotate nginx logs in order have a single log file capped in size

Can use tail to rotate a nginx log file in orderer to have a single log file capped in size? tail -c 1000000 access.log > temp.log mv temp.log access.log kill -USR1 `cat /var/run/nginx.pid` The above would be executed in a cron job (running every 5…
Paolo
  • 149
  • 6