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.

2
votes
1answer
20 views

logrotate with only size option does not rotate. This is inside Alpine docker container

I have below configuration for access logs cat /etc/logrotate.d/logrotate_nginx.conf /nginx/access/logs/*.log { rotate 2 size 1k missingok compress notifempty copytruncate } There is no ...
0
votes
1answer
43 views

Logrotate “permission denied” error

I am trying to get logrotate to work and keep getting the follow error message. /etc/cron.daily/logrotate: error: error accessing /ftp/logs: Permission denied error: error opening /ftp/logs/...
0
votes
0answers
10 views

Configure log-specific olddir for pattern matched logs in logrotate

Is there a way to make log-rotate include the source file in the name of it's archive directory? For security reasons I keep a very long history of Apache logs. With several sites running on this ...
4
votes
3answers
85 views

Why do selinux policies apply to commands (e.g: logrotate) running from cronjobs, but not when run directly from command line?

Why do selinux policies apply to commands (e.g: logrotate) running from cronjobs, but not when run directly from command line? When I run logrotate manually from the command line, it works perfectly. ...
0
votes
1answer
93 views

Logrotate is not rotating automatically, but it's working with logrotate -d and logrotate -f

Logrotate is not rotating automatically, but it's working with logrotate -d and logrotate -f with no errors showing. But it's not running automatically each day. Below is the logrotate -d output. ...
0
votes
1answer
51 views

Logrotate is not compressing

I need to compress the files in var/log/remots/*/* with the following logrotate rule /var/log/remots/*/* { rotate 178 daily maxage 178 compress } located in /etc/logrotate.d/remots. ...
1
vote
1answer
41 views

Log file rotation and compression interval

We have our the logrotate config for a service as below: { rotate 30 create 644 root syslog missingok notifempty daily sharedscripts postrotate /bin/kill -HUP `cat ...
1
vote
0answers
47 views

why messages logs are zero

we have linux machine: more /etc/redhat-release Red Hat Enterprise Linux Server release 7.2 (Maipo) all message files under /var/log are ZERO how it could be ? what is wrong here ? -rw-------. 1 ...
0
votes
2answers
54 views

Syslog Output File Splitting HOURLY at Syslog Server

I have implemented syslog server on CentOS and using below Template to generate output file on daily basis - $template TmplNationalIP_PL, "/var/log/NIPFW/MX480/CGNAT_PL_%$year%.%$month%.%$day%" if ($...
1
vote
1answer
46 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
367 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
47 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
170 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
48 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
278 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
53 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
465 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
101 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
331 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
163 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
748 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
289 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
330 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
869 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
139 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
73 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
16 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
32 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
118 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
40 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
473 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
55 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
56 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
131 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
117 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
3k 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
670 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
296 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
245 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....
1
vote
0answers
42 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 ...
1
vote
1answer
1k 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 ...
2
votes
1answer
402 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
70 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
3
votes
1answer
1k 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
124 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
88 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
4k 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
1k 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
195 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
1k 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 ...