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.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

logrotate not working properly

I'm trying to setup logrotate but for some reasons logrotate isn't rotating the files. It always complains that it cannot find previous log files. Below the content of my logrotate file: /home/cm/...
0
votes
0answers
17 views

Questions about audit and selinux

Recently wanted to keep log on auditd via logrotate But seliunx keeps blocking It is also invalid to follow the action recommended by selinux The action is as follows ausearch -c 'logrotate' --raw | ...
1
vote
0answers
24 views

Script executed by logrotate gives different result than by executing it manually

I want to rotate our application logs using logrotate. After each rotation, it executes a script which moves all rotated logs to another directory. For example in /home/dev/logs/frontend, I have these ...
0
votes
0answers
16 views

Clarification on logrotate

I'm setting up logrotate for several services, and I'm a little confused. I would like to rotate logs for 7 days, tar anything older than that, and delete anything older than 10 days. Here is my ...
0
votes
1answer
20 views

How to check logrotate syntax?

We are suspecting a typo in the /etc/logrotate.d/FOO file. How can we check it? So far I can see from: https://linux.die.net/man/8/logrotate maybe this?: logrotate -df /etc/logrotate.d/FOO 2>&...
0
votes
1answer
15 views

logrotate a frequently written to log without losing data

I want to capture slow queries via logrotate, and I want them to rotate weekly and I want to save a year's worth. The logs take the form: -rw-r-----. 1 mysql root 1239 Feb 21 18:46 mysqld1-...
0
votes
0answers
10 views

Logrotate: Same config, multiple retention policies

I have a service, ServiceA that write to several log files, lets call them /var/log/servicea.log and /var/log/servicea_debug.log. These files, I would like a different retention policies on. However I ...
0
votes
0answers
16 views

Log rotate does not working

/var/log/secure /var/log/warn /var/log/dmesg /var/log/localmessages /var/log/messages /var/log/isdn?.log /var/log/BulkDataHandler.log /var/log/OM*.log /var/log/S*.log /var/log/pcmk_alert_file....
1
vote
1answer
82 views

At what size is *.xsession-errors* turned into *.xsession-errors.old*?

My .xsession-errors file is growing steadily (which is apparently a common phenomenon) and not unexpected (I still have to address some issues on my system). Question: Is there a specific threshold ...
6
votes
2answers
435 views

How does logrotate work?

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't. The command in question is: rclone -L -vv --log-file "/home/mike/...
0
votes
0answers
23 views

Change partition sizes on vm server

I am gathering logs on a server using rsyslog to forward to the server and am having some issue with the partition sizes. Here is the current filesystems and lvms Filesystem Type ...
0
votes
1answer
48 views

Cannot logrotate hourly by cron

I have the following entry in /etc/crontab 47 * * * * root /usr/sbin/logrotate -v -f /etc/logrotate.d/mariadb_dumps &> /tmp/errrot The line is run because the /tmp/errrot if created (empty), ...
0
votes
0answers
29 views

logrotate wildcard generating empty files

I discovered that using wildcard with logrotate give me empty files. I would like to find a solution for not having those empty files created. Many thanks for your help The extract of my /etc/...
0
votes
1answer
22 views

stop/restart background job started by cron

I have the following cronjob which pipes docker (apache) logs into a file: * * * * * flock -n /srv/www/htdocs/scripts/pipe.lock /srv/www/htdocs/scripts/pipe_docker_logs.sh the pipe_docker_logs.sh ...
0
votes
1answer
158 views

/var/log/messages - not compressing while rotating

I'm trying to compress the messages cause its growing huge in size and there is not much space. I tried all from - compress-messages - to compress the messages but its with glob finding old rotated ...
1
vote
0answers
210 views

What permissions should a logrotate file have?

TL;DR: Difference between su pi mail and create 666 pi mail in /etc/logrotate.conf. I am using a script to monitor a service. I have added said script in crontab. crontab runs the script every one ...
1
vote
1answer
172 views

Logging rotation using logrotate and timing

I have just set up a fairly extensive logging and logrotation operation on a system, to hopefully eliminate or at least minimize the risks of out-of-space errors (possible vulnerabilities?). However,...
0
votes
1answer
133 views

rsyslog omprog when an audit logfile is rotated

We have an use case that we need to compress a logfile when it is rotated. More specifically we have the auditd audit trail that is rotated based on size... So when the size of the logfile reaches ...
0
votes
0answers
100 views

Apache log files rotation and webalizer

I have a default installation of Fedora 30 with httpd and webalizer. The webalizer is run in a cron job, but I have the problem that it seems that webalizer is not run regularly. Instead, there are ...
0
votes
0answers
91 views

Can logrotate create missing files?

I was looking through the logrotate directives, and it seems that create will only create a new log file after rotation. I just get an error if the log file is missing. Is there a way to trigger ...
0
votes
0answers
27 views

logrotate create the renmaed files with root as the owner even though I am using 'su myuser myuser'?

I am using logrotate to rtate the logs of an application, and here is the logrotate config file: /home/cowrie/cowrie/log/cowrie.json.????-??-?? /home/cowrie/cowrie/log/cowrie.log.????-??-?? { ...
1
vote
2answers
76 views

Permanently change Squid access.log permissions

I have a squid user, writing to access.log with 640 permissions. Also an nrpe user, reading access.log, but only works with 644 permissions. chmod 644 access.log Does the trick, but only until the ...
0
votes
0answers
85 views

logrotate, permission error: others do not have write access, adding su user does not help

I have a set of log files with the following permissions: -rw-rw-r-- 1 club club and my custom logroate file looks like below: /home/club/club/log/* { size 1M dateext ...
1
vote
1answer
1k views

Airflow log rotation

I am about to use logrotate for the first time, I went through man page and some web guides. I am trying to achieve rotation every week and deletion of the logs that are older than 7 days (I want to ...
1
vote
0answers
513 views

Logrotate + rsyslog issue

Actually, i have an issue with rsyslog. When rsyslog should rotate the log (via logrotate); i got this issue : gzip: standard input: Bad file descriptor error: failed to compress log /var/log/...
1
vote
0answers
691 views

LogRotate: error running non-shared postrotate script

During Daily Log Rotation, we are getting below error. /usr/bin/find: cannot delete ‘/var/log/tomcat/catalina.out’: Permission denied error: error running non-shared postrotate script for /var/log/...
2
votes
2answers
521 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
384 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
32 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 ...
5
votes
4answers
337 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
452 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
374 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
184 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
71 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
278 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
187 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
2k 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 ...
1
vote
0answers
203 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 ...
2
votes
2answers
1k 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
91 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
791 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
78 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
825 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
223 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
822 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
280 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 ...
4
votes
1answer
2k 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
756 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 ...
1
vote
0answers
798 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/...
3
votes
2answers
3k 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 ...

1
2 3 4 5