Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logrotate]

logrotate is a program which is scheduled (usually nightly or weekly) to archive log files by renaming them with a suffix so that the applications writing the log files start writing to new (empty) files.

1
vote
1answer
34 views

Is it possible to automatically zip newly created files in a directory

Context I am required to use a poorly designed java application that logs A LOT of information while it is running. Under standard usage, it will create 100s of MB of logs per hour. I don't need ...
0
votes
1answer
33 views

logrotate not able to truncate catalina.out [duplicate]

I'm running tomcat server in my centos machine. I've following content in my /etc/logrotate.d/tomcat file: /log/apache-tomcat/catalina.out{ copytruncate daily size 256M rotate 8 missingok ...
0
votes
0answers
27 views

mysqladmin generates “error” messages

Some time ago I installed NGINX, php7, mariaDB and Wordpress on my Raspberry Pi running Raspbian. I created a Wordpress database - which is working. Recently I installed ssmtp and mailutils on my ...
1
vote
2answers
37 views

logrotate continues to rotate & compress already rotated logs

I have a log that generates a new log file each day. Here is a listing of each log created since I turned on logging: 2019-01-04 2019-01-05 2019-01-06 2019-01-07 2019-01-08 This is the logrotate ...
0
votes
0answers
34 views

Service stuck and consuming disk space

What is the best practice to avoid this case Example, filebeat 5098 5128 root 3r REG 253,1 31035908096 657022 /var/log/aaa/aaa.access.log.1 (deleted) There is a ...
0
votes
1answer
50 views

Shell script to emulate Logrotate

I've a system that writes files to /var/tmp/log/my.log, I want to write a shell script to rotate the log files when it reaches 1KB limit, so my my.log becomes my.log.1, my.log.1 becomes my.log.2 and ...
1
vote
1answer
44 views

Logs gzipped and not gzipped

Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files: letsencrypt.log letsencrypt.log.1 letsencrypt.log.10 letsencrypt.log.10.gz letsencrypt.log....
-1
votes
1answer
200 views

Rotate Logs Older Than 7 days and Delete Archive [closed]

I'm trying to configure logrotate to find all the log files older than 7 days from certain directories and archive them. The archived files must be deleted. I have a structure as follows. /var/log/...
0
votes
1answer
36 views

Logrotate not occurring automatically

I'm able to call logrotate /etc/logrotate.conf whenever I see my log file exceed the specified threshold and it rotates just fine. I was under the impression though that whenever a file specified in ...
0
votes
1answer
102 views

Logrotate Error : unknown option & unexpected text

I am trying to use logrotate , I have create file in logrotate.d directory with "rotatetest" name. Please see below detail in file: /etc/rsa/rotatetest { create size 100k rotate 10 missingok ...
0
votes
0answers
86 views

For rotating logs- Cronjob issue

Invoking logrotate every 15 mins. logrotate will rotate only after size threshold crosses 1M Working machine [root@machine1 output]# ls -l --block-size=1K total 296 -rw------- 1 root root 55 Oct ...
3
votes
1answer
305 views

How copytruncate actually works? [closed]

we would like to understand copytruncate before rotating the file using logrotate with below configuration: /app/syslog-ng/custom/output/all_devices.log { size 200M copytruncate dateext ...
0
votes
1answer
96 views

How to logrotate 1 MB file?

To rotate logs after the size grows to 1M, cronjob invokes logrotate every 15 mins, as shown below: 0,15,30,45 * * * * /usr/sbin/logrotate /app/syslog-ng/custom/conf/syslog-ng-rotate.conf where ...
0
votes
0answers
185 views

Logrotate syslog-NG logging - RHEL 7.x

/usr/sbin/logrotate is used to log rotate syslog-NG logging, as shown below: [root@machine1 output]# crontab -l # 00 23 * * * /TSM/bkup 1>/dev/null 2>&1 1 * * * * /usr/sbin/logrotate /app/...
1
vote
2answers
366 views

Logrotate: Run postrotate script with rotated file

I'm rotating log files with logrotate with copytruncate, and I need to run a script with the new filename as argument. I understand I can use $1 within postrotate, but that gives me the name of the ...
0
votes
1answer
98 views

bash script - logrotate output rename

When executing logrotate it shows following: error: error creating output file /var/log/remote/172.29.202.29/contrail-vrouter-agent.log.1: File exists error: error creating output file /var/log/...
1
vote
0answers
49 views

Why does logrotate generate empty log files when using two wildcards in log path?

Logrotate will rotate the logs but when it renames the file to .1 (and then subsequently to .2.gz, .3.gz, etc) the files are empty. I've tracked this down to the path specified in the log config file: ...
0
votes
0answers
12 views

Logrotate File Numbering [UBUNTU 14.04]

root@osshonisyslog1s:/var/log/upstart# ls -Anh | grep graylog-server && vim /etc/logrotate.d/upstart -rw-r----- 1 0 0 3.0G Aug 21 11:32 graylog-server.log -rw-r----- 1 0 0 1.1G Aug 21 11:26 ...
0
votes
1answer
21 views

Logrotate Timing?

I've configured logrotation and it works the way I want it to when I force the update. I'm using the filesize condition as you can see in the config below, but I'm wondering how often this condition ...
0
votes
1answer
61 views

Upstart Logrotate?

What's wrong with my config? I had to --force the logrotate a couple times to see changes, but the numbering is all wonky. ----@----------:/var/log/upstart# ls -Anh total 4.0G -rw-r----- ...
1
vote
0answers
35 views

Where do Logrotate files end up?

I've got a Graylog server that I configured logrotating on. /var/lib/graylog-server/journal/messagejournal-0/000*.log { size 2G create 550 ubuntu ubuntu rotate 5 } I came in one morning ...
0
votes
1answer
129 views

Linux logrotate, how to configure logrotate to remove all logs older than one month?

We have Linux Red Hat servers - version 7.2. We have the following Hive logs under /var/log/hive. How can we configure the Linux logrotate so every log file that's older than one month will be ...
0
votes
0answers
37 views

Logrotate ignoring log file without suffix?

My problem is simple. I have 5 log files in a folder, like this: software1.txt, software2.txt, etc. My Logrotate script, as follows, runs daily: /var/ftp/logs/*.txt { daily rotate 36500 ...
0
votes
0answers
38 views

How to auto rotate screen with Gsensor on lxde?

Is there any software let can set auto rotate based on g-sensor value? Or I should design a program myself to execute it in background?
0
votes
2answers
101 views

How to copy desired log file content when logs are frequently being rotated in Linux [closed]

Suppose some logs is being rotated by size 50MB each . I did grep some string and my string is present in a log file, log_3 and I want to copy the content of log_3 before it gets rotated(renamed) to ...
0
votes
1answer
55 views

Best Practice: How to maintain/rotate log files (from redirected output)

I read several question for the mentioned topic, but I'm not sure if they really answer the question for my problem. I have an application running and I redirect the output to a log file, i.e., ...
1
vote
2answers
2k views

Why is kill -HUP used in logrotate in RHEL? Is it necessary in all cases?

I see for syslog logging, kill -HUP is used. /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler { sharedscripts postrotate /bin/kill -HUP `cat /var/run/...
0
votes
1answer
512 views

Logrotate copytruncate option taking too much time

I am running logrotate every 4 hours using crontab. I want to rotate files at every 50G which is expected in 4 hours. My logrotate.config is like below : /log/*/*/*/*.log { size 50G ...
0
votes
1answer
210 views

Logrotate doesn't recognise createolddir option (Debian)

I have found the createolddir command very useful for logrotate to dynamically clean up my log folders, and have this working successfully on other Debian servers without any problems. Just for one ...
0
votes
1answer
143 views

/var/lib/logrotate/status gets invalid entries

We are seeing our /var/lib/logrotate/status gets invalid entries like following: saurabh@1236:~$ cat /var/lib/logrotate/status logrotate state -- version 2 "/var/log/syslog" 2018-3-13 "/var/log/auth....
0
votes
0answers
148 views

NXLog File truncates

I am using NXLog to auto restart process and for email alerts. I also tried to use $Message = substr($raw_event, 0, 1000); But its still giving me the same problem. Due to this error, the S3 sink logs ...
1
vote
0answers
35 views

rsyslog cron.daily warning message

I am running Ubuntu 16.04 and cron is emailing me the following message /etc/cron.daily/logrotate: Warning: Stopping rsyslog.service, but it can still be activated by: syslog.socket I have not made ...
0
votes
0answers
66 views

How to make services reopen logs for write? (when partition of /var/log changes)

How to make services reopen logs for write? Need some universal solution, not configuring for each service. I use /usr/sbin/logrotate -f for that, but may there are some perfect solution? I need this ...
1
vote
1answer
893 views

logrotate permission denied

Why am I getting permission denied on renaming my log file when running logrotate? The owner of my log file shown below is rajohns which is the same user that is logged in running the logrotate ...
3
votes
1answer
309 views

Log rotate using perl Logfile::Rotate

The below script works when executed on CentOS, but it doesn't rotate logs based on size. A new log is generated every time I execute this script. Can anyone tell me how to make this script work based ...
-5
votes
1answer
63 views

Rename Oracle logs with the current date [duplicate]

I would like to rename my Oracle alert logs with the current date and compress them after X days. Could this be done with a shell script? Also I must not use logrotate
2
votes
1answer
926 views

Logrotate Tomcat log file

I am writing Tomcat log with this setting: Log configured using an AccessLogValve in server.xml Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="access" ...
0
votes
1answer
112 views

Linux is spamming me now (anacron)

Since about a year ago, linux Debian has been spamming me with messages like the following: Subject: Anacron job 'cron.daily' on mymachine Content-Type: text/plain; charset=UTF-8 Date: Mon, 3 Apr ...
1
vote
1answer
71 views

what if two logrotate run concurrently

I know this sounds weird... I have a project which will run "logrotate myConf.conf" automatically every hour. Besides, in my cron/, there is also a logrotate running... The two process might have ...
0
votes
1answer
3k views

Logrotate daily+maxsize is not rotating

I've CentOS 7.4 with logrotate 3.8.6 installed. I've a custom logrotate file under /etc/logrotate.d/ to rotate some logs on a Tomcat (e.g., catalina.out) which is installed in the same machine. /opt/...
1
vote
1answer
802 views

how to get rotations with the date of the previous day?

Every day at midnight, the achievement processes with logrotate begin, which I have set up. But I'm faced with the problem that once the rotation is finished, it has the name of the current day and I'...
1
vote
1answer
124 views

Transfer old log files before they are deleted by logrotate

I'm using Debian Stretch on my server. Here is the relevant portion of etc/logrotate.d/rsyslog: /var/log/mail.info /var/log/mail.warn /var/log/mail.err /var/log/mail.log { rotate 4 ...
0
votes
1answer
833 views

Can the logrotate descriptor handle multiple wildcards?

For example, on a syslog collector, where remote syslog is coming into /var/syslog/<host>/*.log, can I have something like the following in my logrotate config: /var/syslog/*/*.log { daily ...
1
vote
2answers
3k views

Why is logrotate not automatically rotated?

I've set you up to rotate daily, but you don't. But when I do it manually, it does work. logrotate -vf /etc/logrotate.conf This is my log file to rotate. /mylogs/log (-rwxrwxrwxrwx 1 admin admin) ...
1
vote
2answers
2k views

Accidentally set chmod 777 to /var/log

So I've set chmod 777 -R to /var/log on Raspbian and now I get some errors when logrotate runs. The errors are like: error: skipping "/var/log/apt/term.log" because parent directory has insecure ...
0
votes
0answers
121 views

rotate log unable te delete old files

With apache i decide to manage log with logrotate i wanted to keep logs for 60 days, older than that must be deleted, so i added the following : /var/log/httpd/* { daily size 10M rotate 15 maxage 60 ...
1
vote
0answers
843 views

maxage option in logrotate not working as expected

I am rotating my logs using logrotate in linux. I want to remove my logs older than 7 days. So I tried maxage option in logrotate but it is not working as expected. Let say I have 6 logs which is ...
0
votes
2answers
675 views

fail2ban:11 lines must begin with a keyword or a filename (possibly in double quotes)

I am rotating the logs of my Fail2Ban service on a daily basis, but, I keep getting this error on a daily basis: /etc/cron.daily/logrotate: error: fail2ban:11 lines must begin with a keyword or a ...
0
votes
0answers
34 views

Application log file not growing after 2Gig

I've an application installed in RHEL 7.1 3.1 kernal 64 bit. In my application we haven't configured log rotation. So, expecting log file should grow indefinitely. But the log file is not growing ...
1
vote
0answers
1k views

Logrotate rotate not working

I have a bunch of messages files in /var/log that stretches all the way to April of 2017 (not posting the whole output of ls as there are a lot of files) The archived messages go from messages.2.gz to ...