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
17 views

How to logrotate in any user dir as user?

We have one file, need to timestamp it and archive it in order to prevent overwrites. Solution must work in any user directory. Solution must be foolproof. Solution should work without superuser ...
0
votes
0answers
8 views

Read all new lines from a logrotate'd log file

There's a process that is continuously writing logs to a file. Those logs are rotated daily via logrotate. The main log file is "blah.log" and the first rotated version is "blah.log.1&...
0
votes
1answer
27 views

Is it safe to change logrotate rotate config? Any risk of old logs being deleted?

I'd like to change the config of rotate 16 to rotate 104 for a logrotate config. Is this a safe operation? Can it potentially mess up the order / loose log entries? Yes I can and should make backups ...
0
votes
0answers
28 views

OpenResty/Nginx logging to .log.1 instead of .log and not zipping older logs

I am using openresty which extends nginx. The issue is that it keeps logging to access.log.1 instead of access.log. This file keeps growing forever and it never gets gzipped and rotated. access.log ...
0
votes
0answers
7 views

Logrotate permission errors when using compress

I'm struggling to make logrotate work. Basically I just want to have a cronjob run once an hour to rotate my logs. Now I had this working initially but logrotate completely crapped itself and stopped ...
1
vote
0answers
50 views

dmesg + how to enable dmesg history logs

We have RHEL server version 7.2 and we noticed that dmesg files from previous sessions under /var/log are not created what we have under /var/log are only ls -ltr | grep dmesg -rw-r--r-- 1 root ...
0
votes
0answers
16 views

Logrotate rotating one hour after log creation instead of on the hour

I have the following logrotate config that I want to use to rotate a log hourly. It works but I noticed that instead of logrotate rotating on the hour (e.g. 13:00, 14:00), it seems to rotate an hour ...
0
votes
0answers
17 views

Using logrotate with systemd's StandardOuput

If my systemd unit for my daemon is the following: [Unit] Description=a website website Requires=nginx.service [Service] Type=simple ExecStart=/usr/bin/mydaemon StandardOutput=append:/var/log/...
1
vote
1answer
14 views

Getting name of logrotate file?

Let me start by saying I'm very new to linux and bash scripting, only been at this for 2 weeks so assume I know nothing! For development reasons, I need to copy a log file to another location and name,...
0
votes
1answer
18 views

after editing logrotate file do I need to restart something?

After editing /etc/logrotate.d/rsyslog do I need to restart some service before it takes effect?
0
votes
1answer
35 views

Using openrc and using logrotate causes logging to stop working using Alpine Linux

I'm using a very vanilla openrc service to run a Go application I wrote that spits out logging data to stdout which was working perfectly fine before I enabled logrorate on my application's log files. ...
0
votes
1answer
92 views

logrotate not splitting log file

I am trying to get logrotate to work on my OpenResty server logs. My logrotate configuration file /etc/logrotate.d/openresty should execute daily which is default behavior and I'm trying to run it ...
0
votes
1answer
45 views

Modify logrotate defaults on Ubuntu

Ubuntu 18.04 has default configurations of packages for logrotate in /etc/logrotate.d For example with nginx installed I have a file /etc/logrotate.d/nginx /var/log/nginx/*.log { daily ...
0
votes
0answers
17 views

Aws Ubuntu instance with ebs volume has run out of disk space?how to clear any unwanted files which clear disk space

I am running many python process as services under SystemD. The count could exceed 200 python system services which i found using the below command systemctl list-units --type=service | grep "...
1
vote
1answer
413 views

How to properly logrotate logs of service managed by systemd via `file:` config

I have a service managed by systemd that has the following systemd config telling systemd to write the logs to a file directly (no syslog or anything) StandardOutput=file:/var/log/foo/my.log I have a ...
0
votes
0answers
24 views

logrotate script for xinetd postrotate

I need help with rotating my xinetd.log file. I'm using CentOS8 and I have this logrotate file: /var/log/xinetd.log { compress dateext daily rotate 7 missingok copytruncate ...
0
votes
0answers
44 views

internal logrotate mechanism in syslog-ng

Does the syslog-ng has its own rotating mechanism? I am new to auditing and linux and I though I could use logrotate but I noticed that I need to restart the syslog-ng daemon every time when I use it ...
0
votes
1answer
161 views

Adjust logrotate to use xz for logs

On a current Debian Testing machine, I am wanting to use xz to compress log files instead of GZip. It has higher compression out of the box, and as such I wish to use it. However, whenever I specify ...
1
vote
1answer
97 views

Bash script to split logs based on file size

I'm working on a .bash script that kicks off a Java program, logs the sysouts to an 'outfile', then appends the log results for historical purposes to a 'archive' zip. My current script is like below.....
0
votes
0answers
76 views

Custom logrotate with hostnames

I have recently set up my central log server on CentOS 8, I had the following template on my main server: $template RemoteMessages, "/var/log/%HOSTNAME%/messages" $template RemoteSecure, &...
1
vote
1answer
115 views

auditd not compressing logs during rotation

Audit is not compressing any logs. Perhaps this is a config issue. Could you perhaps tell me what's causing this in the below config? local_events = yes write_logs = yes log_file = /var/log/audit/...
0
votes
2answers
19 views

logrotate: what counts as rotation? single files or single executions?

Let's ipothize I've a directory with 2 logs access.log error.log My logrotate is configured for daily rotation with 10 as rotation My question is: will I end up with 20 files or with 10 files ?
0
votes
1answer
44 views

Why am I still seeing old log files and not having new ones?

This is my setting logrotate /home/sy/logs/kitxit*/*/tend.log { daily rotate 10 dateext compress delaycompress copytruncate missingok ...
0
votes
1answer
42 views

Linux logrotation file showing incorrect size than usual

I have enabled logrotation under springboot directory and it is working but what i see is, "content-data-svc.log" is actually 2MB but when i do ls -ltrh it is showing as 61MB. if i view the log file,...
1
vote
0answers
269 views

logrotate is not working in RHEL7

I have enabled below log rotation on my VM but still logs are not getting rotated for next day, still I see logs are appending in 1 log file. What I actually need is, imagine a service got started ...
0
votes
0answers
156 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
25 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
1answer
33 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
22 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 ...
1
vote
1answer
306 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
51 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-...
1
vote
1answer
477 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
2k 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
1answer
181 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
248 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
32 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
839 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
969 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
346 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
268 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 ...
1
vote
0answers
280 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 ...
2
votes
2answers
343 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
314 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
2k 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
942 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
2k 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
892 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
1k 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
59 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 ...
6
votes
4answers
814 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. ...

1
2 3 4 5