Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logrotate]

The tag has no usage guidance.

0
votes
0answers
11 views

saving day old log files in /var/log/apache2/rotate with compression

One of the production servers at my work has a /varlog/apache2 directory that looks like this: servername.com-access.log rotated/servername.com-access.log-20190127 rotated/servername.com-access.log-...
0
votes
1answer
36 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
0answers
8 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
0answers
8 views

Issue using Kafka Standalone Connect with Squid rotation logs

I need help with the following scenario: A Kafka standalone connect is running reading a squid proxy file: /opt/kafka/bin/connect-standalone.sh -daemon /opt/kafka/config/connect-standalone....
0
votes
1answer
13 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 ...
0
votes
1answer
102 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
0answers
16 views

How to tell if logs are actually rotating?

I am running an Ubuntu 16.04 server with apache2 installed. I have been looking at the items in /var/logs/ and it seems like some of them are growing beyond the limits setup in the logrotate files. ...
0
votes
2answers
39 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
1answer
54 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
1answer
269 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 ...
0
votes
1answer
2k 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
2answers
307 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 ...
0
votes
2answers
995 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
2answers
2k 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 ...
9
votes
1answer
6k 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
1answer
799 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
0answers
550 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/...
5
votes
2answers
256 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
2answers
607 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
0answers
44 views

Logrotate - leave file with some content

im looking for a tool or script which logrotates a folder of log files, but leaves some lines in the logs for ex. it cuts all lines older than 2 days and writes them into another file. are there any ...
0
votes
1answer
631 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 ...
1
vote
2answers
1k 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
0answers
488 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
1answer
996 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
1answer
2k 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
2answers
2k 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
1answer
347 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 ...
0
votes
1answer
781 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
1answer
2k 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
1answer
970 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
2answers
1k 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
2answers
3k 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
15
votes
2answers
4k 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 /...
8
votes
2answers
11k 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
1answer
137 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>>/...
2
votes
2answers
3k 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
1answer
76 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
0answers
925 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: ./...
0
votes
1answer
410 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 ...
5
votes
2answers
2k views

Will cron.daily wait for jobs to finish before starting the next one?

This page http://wiki.ci.uchicago.edu/I2U2/WebalizerConfiguration suggests renaming /etc/cron.daily/logrotate so it comes after /etc/cron.daily/webalizer - webalizer should be done before logrotate ...
0
votes
1answer
2k views

Logrotate says “log needs rotating” and then does nothing

I have the following logrotate configuration, and a 2 GB /var/log/messages: /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/network { ...
0
votes
2answers
12k views

Logrotate not doing any rotation

I just set up LogRotate on my RHEL6 server so that it rotates my custom Apache log files. However, it doesn't do anything when i try manually running it. I expect it to rotate the log files "access....
1
vote
1answer
1k views

Logrotate append to existing file and truncate original

Is it possible with logrotate to take the content of a log and add it to an existing file? Like so: 1. Put the content of /var/log/vnc.log after the content of /archive/logs/vnc.log 2. Truncate /...
1
vote
2answers
1k views

Merge and view rotated and compressed logfiles

I have a bunch of partly compressed rotated logfiles from a Glassfish application server (using a custom Java logging format): /tmp/server.log /tmp/server.log.13.gz /tmp/server.log.18.gz /...
2
votes
0answers
7k views

Logrotate appending file name with a “.1”

For some reason our tomcatlogs are being appended with a .1 when logrotate runs. e.g: file "tcl-2013-08-16.0.log" becomes "tcl-2013-08-16.0.1.log". I am struggling to find what setting is adding the "....
1
vote
2answers
2k views

Are the .log.gz old log files?

I have a couple of .log.#.gz files. (the # is a number) For example i have a ufw.log, a ufw.log.1.gz...all the way to ufw.log.4.gz. Are these .log.#.gz files old log files that got compressed? What ...
1
vote
0answers
102 views

Weird Disk space usage Ubuntu 10.04

I have an ubuntu 10.04 server. For the past couple weeks, or as long as I can remember my disk space was going down by about 1 kb per minute (I assume from the massive logs). However all of a sudden ...
2
votes
1answer
2k views

rsync: excluding log rotation files .gz.1, .gz.2 etc

I am doing rsync copies between server. I'd like to exclude compressed log rotate files from the process. The files look like *.gz *.gz.1 *.gz.2 *.gz.[0-99] I was unable to come up with ...
0
votes
1answer
50 views

How to make sure to have always enough disc space by deleting files from directories that are the oldest

I want to make sure that the server we use for logging certain things never runs out of disc space because of too many logs. The oldest logs shall be deleted when disc space is running low. Are there ...
0
votes
1answer
2k views

linux logrotate how to set rules for all log files in an directory(including files in sub-directory)

For example, I want to set rules for all files under /home/example_user/public/ and all logs are actually located in different sub-directories like this: /home/example_user/public/siteA/access.log, /...