2022 Developer Survey is open! Take survey.

Questions tagged [logrotate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 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 ...
user avatar
  • 487
0 votes
0 answers
93 views

Logrotate - process entire /var/log/ folder for *.log files - olddir output needs to retain the filesystem structure

Currently I have an entry in logrotate for every single device talking back to the rsyslog server. /var/log/remotelogs/10.1.100.10/*.log { rotate 90 daily missingok ...
user avatar
  • 1
0 votes
1 answer
100 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 ...
user avatar
  • 304
0 votes
0 answers
19 views

Can we call a function inside a log rotation process on an Ubuntu machine?

I need to call only a date expiry check function inside a log rotation process on daily basis. Can we do that ?? Kindly help me with this as I am new to job rotation and cron job scheduling. Thanks in ...
user avatar
0 votes
0 answers
52 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, ...
user avatar
0 votes
0 answers
371 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 ...
user avatar
  • 317
2 votes
2 answers
517 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 || ...
user avatar
  • 123
0 votes
1 answer
206 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 ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
2 votes
0 answers
268 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 *...
user avatar
  • 21
0 votes
1 answer
240 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 ...
user avatar
  • 161
1 vote
0 answers
234 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 ...
user avatar
0 votes
0 answers
46 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,...
user avatar
1 vote
0 answers
399 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 ...
user avatar
0 votes
1 answer
53 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
0 votes
0 answers
304 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 ...
user avatar
  • 101
0 votes
1 answer
242 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 ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
  • 136
0 votes
2 answers
57 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 ...
user avatar
  • 143
0 votes
1 answer
240 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 ...
user avatar
  • 103
-2 votes
1 answer
757 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 ...
user avatar
  • 1,307
2 votes
1 answer
8k 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 ...
user avatar
  • 141
1 vote
2 answers
913 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 ...
user avatar
  • 163
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 ...
user avatar
0 votes
2 answers
6k 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 ...
user avatar
19 votes
1 answer
26k 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). ...
user avatar
  • 293
0 votes
1 answer
1k 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`...
user avatar
0 votes
0 answers
964 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/...
user avatar
  • 101
3 votes
2 answers
506 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?
user avatar
  • 145
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 ...
user avatar
  • 151
0 votes
1 answer
1k 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 ...
user avatar
  • 105
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 ...
user avatar
  • 163
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 ...
user avatar
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 ...
user avatar
  • 143
3 votes
1 answer
3k 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 ...
user avatar
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 "...
user avatar
0 votes
1 answer
726 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 ...
user avatar
  • 101
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 ...
user avatar
  • 193
1 vote
1 answer
3k 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 ...
user avatar
  • 6,690
0 votes
1 answer
1k 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, ...
user avatar
  • 101
0 votes
2 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 ...
user avatar
  • 1
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
user avatar
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 /...
user avatar
12 votes
4 answers
19k 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. ...
user avatar
0 votes
1 answer
199 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>>/...
user avatar
  • 173
4 votes
2 answers
5k 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 ...
user avatar
  • 43
0 votes
1 answer
87 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. ...
user avatar
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: ./...
user avatar
  • 15.9k
0 votes
1 answer
449 views

Capture logrotated files on change

This is something rather special, but I bet you can help me out. I'm working in an environment where many logfiles are generated and rotated, mainly from java-services runnning. As we are performing ...
user avatar