Questions tagged [logrotate]
The logrotate tag has no usage guidance.
74
questions
0
votes
1
answer
29
views
postfix logrotato --> empty maillog_file
When running postfix logrotate, I get the error fatal: empty 'maillog_file' parameter value. logrotation failed. There is mention of logrotate the main.cf documentation but I don't understand what ...
0
votes
1
answer
497
views
how to change user and group of a file inside the docker in gitlab-ci
I have a file which when I mount it to the docker, the user and group will change.
root@b2d3cb9b2aab:/# ls -lh /etc/logrotate.d/
total 36K
-rw-r--r-- 1 root root 120 Sep 11 2021 alternatives
-rw-r--...
0
votes
1
answer
591
views
Logrotate not installed as a systemd service
I have installed via apt logrotate.
However I don't see any systemd service.
Does this requires a separate process for setting up logrotate as a systemd service?
root@myserver:~# apt install -y ...
0
votes
0
answers
27
views
logrorate.d generating files that have endlessly appended dates and doesn’t see to compress files
I tried to configure my logrotate.d as below, it generates files with funny names (ex: 0220420-20220421-20220422-20220423-20220424-20220425-20220426 appended to it), I want to check is it working as ...
0
votes
1
answer
572
views
systemd & logrotate: missing error messages in systemd journal
I have just discovered a problem that I don't understand (SLES15 SP2):
I had mis-configured one logrotate service (in /etc/logrotate.d).
In SLES 15 logrotate.service is triggered by logrotate.timer ...
0
votes
0
answers
805
views
Copying a file while its being written to (in Linux)
I am in a year-long Twitter research project, and I collect tweets via Twitters API and Twarc.
In short, this writes a new tweet as a new line to one specified file, roughly one per second at night, ...
0
votes
0
answers
467
views
How could I use logrotate and group by day a bunch of gzip files with an uncompresssed extension?
Doing a test in a production enviroment with rotation logs with 2 days just for testing purposes with gizp files. Created a test file at /tmp/.
/etc/init.d/test
/tmp/test/*.gz {
daily
...
2
votes
3
answers
2k
views
Logrotate running at wrong hour/time
I have the following entry in my /etc/crontab file to ensure that daily cronjobs run at 4:25 AM. This is the only entry for daily inside this file:
25 4 * * * root test -x /usr/sbin/anacron || ...
0
votes
1
answer
349
views
Logrotate status file update from different crone jobs
I have several scripts in /etc/logrotate.d/ all are included in /etc/logrotate.conf and crone job that runs:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
daily. But I ...
3
votes
1
answer
6k
views
Why logrotate maxsize condition is not working?
I've specific problem with logrotate which is rotating before reaches the limit - set by maxsize
logrotate version - 3.8.6
I've a custom logrotate file
/var/web/log/access_log
{
rotate 40
...
2
votes
0
answers
593
views
rsyslog stopped forwarding httpd logs after logrotate
I have an issue where rsyslog stops forwarding httpd logs to our central log repo after logrotate. Server is RHEL7. My investigations thus far have led me here:
(in /var/lib/rsyslog)
#: grep httpd *...
0
votes
1
answer
399
views
/var/log/firewalld is not getting rotated
I am not sure why this particular file is not getting rotated. It is not a directory. Any ideas?
The size of the firewalld file:
$ ls -alh /var/log
-rw-r--r--. 1 root root 134M Jan 31 13:49 ...
1
vote
0
answers
331
views
How to troubleshoot logrotate / journal on Debian 9
My question today is about the art of troubleshooting with the topic of logrotate and journalctl. I'm interested in learning how to debug and troubleshoot my logrotate and journal configuration.
The ...
1
vote
0
answers
63
views
looking for continuous Screen Capture for retroactivly reproducing errors, timeback machine
Usually Screen Video Capturing software are tailored for kind of video producers, who have a plan, have prepared keynotes, etc.
However, I want a "time machine" program for a specific use case:
Hey,...
1
vote
0
answers
464
views
Reading log files using logstash which rotates every day
I am reading a log file using file input plugin in logstash and sending this logs to elastic search. Log file is rotated at every 00:00. When I rotate log file, the file is zipped and moved to a ...
0
votes
1
answer
124
views
How do I keep 110 files before allowing linux to rotate the logs?
I'm trying to find out whether it is possible to configure linux to keep 110 copies of the audit log files. The setting is under /etc/audit/auditd.conf num_logs = 99
From reading, I understand that ...
1
vote
1
answer
3k
views
Systemd logrotate to specific folder
I have my systemd service file, which runs guncorn app, and that generates logs to a specific folder, But i want to create a logrotate for service file that generate my logs on daily basis and create ...
0
votes
0
answers
498
views
How to get new generated file name on logrotate?
I want to get new file name generated by Logrotate and run a script on it.
Logrotate has an event called Postrotate() with a parameter called '$1' but it returns the original path file name for ...
0
votes
1
answer
338
views
logrotate for already rotated logs
We already have logs for an application that are separated for every day.
they look like this:
-rw-rw-r-- 1 ubuntu ubuntu 23616 Jul 1 2018 01072018.log
-rw-rw-r-- 1 ubuntu ubuntu 340980 Aug 1 ...
3
votes
1
answer
3k
views
Logrotate - can I configure multiple services in one configuration file?
I am planning some infrastructural architecture. It seems as if logrotate configuration files in /etc/logrotate.d usually handle exactly one type of log rotation.
My question: Would it be possible ...
0
votes
2
answers
60
views
Watch (rotating) log in screen
I'm running a mailserver which I connect to using SSH. My .bash_profile is configured to attatch a SSH session to a certain screen session.
Now I'd like to have a log (e.g. the syslog) printed to one ...
0
votes
1
answer
311
views
Configure Logrotate to only rotate partially
I'm using Logrotate to rotate Apache logs. But instead of starting with an empty log file after each rotation, I'd like to keep some lines from the old log.
Is there a solution which prevents the ...
-2
votes
1
answer
837
views
Logrotating postgres logs
My PostgreSQL log is writing as a single file. Its becoming bigger and bigger day by say as postgresql.log. I can see logging_collector is set as ON and log_rotation_age is also set to 1 day. Still ...
2
votes
1
answer
10k
views
logrotate failing to rotate, permission denied as root user
I'm having a problem that I cannot wrap my head around. I've setup logrotate on a centos 7 server to rotate my app logs.
This file is in /etc/cron.daily (i even added a whoami to verify it's running ...
1
vote
2
answers
984
views
My Linux logrotate and my huges log files
I can see a few huge log files in my server:
stephane@data:~$ ls -lS /var/log
total 55G
-rw-r----- 1 root 15G août 9 23:32 syslog.1
-rw-r----- 1 root 15G août 9 23:32 ...
1
vote
3
answers
3k
views
logrotate does not rotate at the time specified in crontab
I am wondering why logrotate does not rotate my logfiles at the time which it is called through crontab.
My entry in crontab is:
50 2 * * * /usr/sbin/logrotate
Therefore all my logs should be ...
0
votes
2
answers
8k
views
What is rotating my haproxy logs?
I have a haproxy logrotate configuration file in /etc/logrotate.d/haproxy that looks like this:
"var/log/haproxy.log" "/var/log/haproxy-status.log" {
daily
size 250M
rotate 1
create 644 root ...
25
votes
1
answer
38k
views
How to logrotate with systemd?
I'm running a node app using systemd with a unit file. The apps log can be viewed using journalctl -u example.com but the log gets cut at some point, erasing the history (which I need for debugging).
...
0
votes
1
answer
2k
views
logrotate files older than x hours
What's wrong with this rotate.conf?
Goal is to delete only files older than four hours
path/to/tokens/*.tkn {
nosharedscripts
prerotate
if test `stat --format=%Y $1` -le $(( `date +%s`...
0
votes
0
answers
1k
views
Nginx write logs to the old file after running logrotate
The logrotate config is:
cat /etc/logrotate.d/nginx:
/data/logs/nginx/*.log
{
daily
dateext
dateformat .%Y-%m-%d
rotate 30
missingok
create
notifempty
sharedscripts
postrotate
[ ! -f /usr/...
3
votes
2
answers
691
views
Why the logrotate's bin path is `/usr/sbin`
Why is the logrotate's bin path /usr/sbin on Debian (at least "wheezy”)
knowing that we can actually use it without the root privilege?
0
votes
2
answers
1k
views
Logrotate wildcard fails on missing files with "missingok" AND "olddir"
Platform:
RHEL 7
logrotate-3.8.6-7.el7_2.x86_64
Background:
On a RedHat Linux server I have a large set of application servers running, and want a uniform logrotate routine for cleaning up log ...
0
votes
1
answer
2k
views
How can logrotate execution result in "service: not found"?
I am trying to understand the output of my logrotate script execution:
error: error running shared postrotate script for '/var/log/nginx/*.log '
logrotate_script: 2: logrotate_script: service: not ...
2
votes
2
answers
4k
views
Logrotate won't rotate log while saying it does
I have a logrotate config that worked normally, until all of a sudden it stopped doing so. I guess that it stopped rotating my log after I deleted and recreated the log folder while updating my ...
0
votes
0
answers
1k
views
Logrotating all logs in a directory causes date duplication
I have a logrotate config that looks like this:
/var/log/update-job/*.log {
daily
rotate 7
compress
delaycompress
size 0k
missingok
copytruncate
notifempty
dateext
...
0
votes
1
answer
1k
views
Logrotate not rotating my logs
Running on Ubuntu 14.04, I have the following logrotate config under /etc/logrotate.d/logstash
/opt/app/logs/logstash*.log {
size 1g
create 700 app app
rotate 5
}
This log ...
3
votes
1
answer
4k
views
logrotate: How to configure and override defaults?
I'm testing a logrotate configuration in /tmp. I'd like
to configure a default logrotate policy for /tmp/*.log files using my test configuration file /tmp/logrotate.conf
to handle a particular log ...
1
vote
2
answers
4k
views
logrotate in SUSE Enterprise Server
I can't manage to work this dummy config file (I placed it in etc/logrotate.d):
/var/log/test_log/mylogfile {
copytruncate
dateext
rotate 3
compress
missingok
size=+2
}
I write to the log (echo "...
0
votes
1
answer
848
views
How do I stop recurring error messages from appearing in messages and auditd.log?
On my CentOS linux machine, in my auditd.conf file, I have set my max_log_file_action=keep_logs.
However, in my /var/log/messages and /var/log/auditd.log, the following message appears multiple times ...
1
vote
1
answer
2k
views
How to run logrotate as a local user?
I'm trying to manage logs which are generated by local scripts. These logs are nothing but stdout and stderr redirected to local files. I don't have root access and trying to run logrotate as a ...
1
vote
1
answer
4k
views
Logrotate error: No file found
One of our servers has a recurring error message for Logrotate.
/etc/cron.daily/logrotate: ERROR No file found for /usr/local/Zend/apache2/logs/error_log
Log rotation is working normally for the ...
0
votes
1
answer
2k
views
Logrotate not rotating on file size
According to the man page "Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the criterium for that log is based on the log’s size". So, ...
0
votes
3
answers
2k
views
Remove leading null blocks from a sparse file
I'm using logrotate with the copytruncate option. This works well, creating a sparse file that starts with an increasing number of "virtual" null blocks that take up no space on disk.
The problem is ...
1
vote
2
answers
4k
views
Disable Logging on Raspian/Debian
I want to stop my Raspberry Pi to create System-wide Logs in Order to save Memory Space.
Is there a Way to disable Logrotate?
I Hope You can help me
18
votes
2
answers
6k
views
Logrotate no longer reads symlinked configuration file due to non-root ownership
We are currently upgrading from Ubuntu 12.04 LTS to 14.04 LTS on our ruby on rails application servers, and have noticed that the log files are no longer rotating.
On both machines we have a file /...
12
votes
4
answers
22k
views
logrotate unable to rotate logs, getting "No such file error"
logrotate is unable to rotate my logs. I have checked the file permissions, they are fine.
I have even tried by putting "su root root" in the configuration file, still I am facing the same issue.
...
0
votes
1
answer
213
views
LogRotate Custom Script Logs Breaks Script?
I have a daemon script I made that always runs in the background. It's setup to pipe stdout and stderr to some log files as such:
python27 etl_daemon.py 1>>/var/log/etl/etl_stdout.log 2>>/...
5
votes
2
answers
6k
views
How to rotate enumerated filenames similar to logrotate?
I have a couple of files, let's say map-0.jpg (newest), map-1.jpg, map-2.jpg, ..., map-9.jpg (oldest). Now my cronjob downloads a new picture from the internet and should save it as map-0.jpg. All ...
0
votes
1
answer
92
views
Use logrotate with manual file management
I'm trying to use logrotate with some unfriendly software. I don't want to court data loss with the copytruncate option. Instead, the software has an internal (gimped) rotate capability. ...
2
votes
0
answers
1k
views
Is there a tool like `cronolog` or `rotatelogs`, but also with compression and removal like in `logrotate`?
I want simple piped logging without config files or system-wide rules for periodic command execution.
Are there any projects that allows to do that? Expecting something like this:
./...