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]

A program for managing and archiving individual log files. It allows automatic rotation, compression, removal, and mailing of log files. Jobs can be configured to run hourly, daily, weekly, monthly, yearly or when reaching a certain size or age.

1
vote
2answers
20 views

Logrotate on “not always on” system

I have several Ubuntu 16.04 and 18.04 systems, whose have no defined operating hours, for example desktop, laptop or VMs runt on demand. What are the right ways and tools to automatically rotate logs ...
0
votes
0answers
16 views

Logrotate not rotating error.log but working on other access logs

I'm trying to get logrotate to rotate the nginx error.log that sits in /var/log/nginx/error.log. I've got the following config and this is successfully rotating the website logs that sit in /var/log/...
1
vote
1answer
68 views

Ubuntu 18.10 Tomcat8 catalina.out file path

In previosu version, I saw that the catalina.out file was created at /var/log/tomcat8/catalina.out location. As I was study for my current installation, Ubuntu 18.10 and last package version, I saw ...
2
votes
1answer
116 views

How to set size for system log

My server dumps because of huge system log files. I've heard that we could limit the size of system log by adding such a line size 100m into the file /etc/logrotate.d/rsyslog to do so. Now my /etc/...
0
votes
0answers
12 views

log rotation: which files would be rotated by default?

From logrotate documentation, I find out that it rotates the files specified in the /etc/logrotate.d/appname files, it also says that /etc/logrotate.conf would be applied by default by logrotate, I ...
0
votes
0answers
62 views

Mysql bin.log file rotation

I am trying to change the binary log rotation from days to hours. By default there is an option only for days in mysql config file: expire_logs_days. Is there any way, where i could change binary log ...
1
vote
2answers
199 views

Where should I look for logrotate config file of /var/log/mail.log

I would like to change the suffix of mail.log rotated files to include the date, such as /var/log/mail.log.20180920 I read from this question that /etc/cron.weekly/sysklogd should be changed, but I ...
0
votes
0answers
81 views

How to logrotate forever log file

I am using below config file to logroate my node.js forever log file. Instead of log rotation it's emptying the file and forever stops writing any further logs to that file. "/mnt/log/forever/...
0
votes
1answer
108 views

What is the syntax for commenting out lines in logrotate config files?

Not sure if this is possible at all. And what about empty lines? Update: Testing the config with logrotate -d /etc/logrotate.d/apache2 returns error: /etc/logrotate.d/apache2:1 lines must begin ...
0
votes
1answer
34 views

Does logrotate handle wildcards the same as ls?

I'd like to specify the files for logrotate to handle via the following wildcard string: /home/deploy/*/logs/nginx-*.log If I do ls with this wildcard string, it shows exactly the files I want to be ...
0
votes
0answers
46 views

logrotate is unable to list the created files in linux

i created my logrotate in /etc/logrotate.d/rsyslog /var/log/pcapcapture/capture.log { maxsize 100k minsize 100k hourly ...
3
votes
1answer
795 views

Logrotate configuration: it works, but always keeps 'current' log empty

I moved logging for openvpn into its own log and attempted to set up log rotation for it, but I've obviously done something wrong. Logging occurs as desired but always into the 2nd logfileopenvpn.log....
1
vote
0answers
95 views

Daily compress log files not working

This is the log file I am using to compress log files on a daily basis. /home/ubuntu/logs/server.log { daily missingok rotate 1 compress create dateext dateyesterday ...
0
votes
1answer
125 views

logrotate weekly archiving empties out daily files

My aim is to maintain 4 days' worth of log files so that on the fifth day, a zip file with all four log files is created. The four log files created so far are deleted. This is my logrotate.conf: /...
2
votes
1answer
268 views

How to configure logrotate in a default, most basic conf for an all-default system?

I have an all-default Ubuntu VPS machine with Nginx, for a few light WordPress sites with say up to 5 plugins, 10 webpages, 20 images each. So far I cleaned all default logs (or at least some of them)...
0
votes
1answer
654 views

What is the easiest way to setup Log rotation [duplicate]

Recently, I have setup a script that outputs to a single log file... After quite a while this file begins to become too large to manage. I was wondering what the easiest way is to setup log rotations ...
1
vote
0answers
448 views

rsyslog not write log after logrotate

OS: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-101-generic x86_64) rsyslog not writing logfile mail.log after logrotate, file mail.log is empty. After restart rsyslog (service rsyslog restart) mail.log ...
1
vote
0answers
275 views

Log rotation is not working automatically

Trying to create log rotation, but it's not working automatically. write following code in .sh file and store in /etc/logratate.d/xxx: /var/log/xxx/*.log { daily missingok rotate 10 compress ...
3
votes
1answer
304 views

How to rotate graphite's logs?

We have the graphite-web package installed, which came with its /etc/logrotate.d/graphite-web. Unfortunately, the "out-of-the-box" file is broken -- the files are rotated, but the daemons writing ...
0
votes
2answers
419 views

How do I rotate my logs despite having running processes?

I'm running Ubuntu 14.04. I have this Rails project and my logs are exploding out of control size-wise ... myuser@myapp:~$ ls -al /home/rails/myapp/log/ total 3118220 drwxr-xr-x 2 rails rails ...
1
vote
1answer
36 views

logrotate does not produce any output

I set up a logrotate configuration file containing containing two entries. the file contains the following: /var/www/designer-24.com/var/log/* { daily missingok rotate 7 dateext ...
2
votes
1answer
4k views

How to rotate a log file in ubuntu on size basis hourly?

/opt/variable/log/myapp.log { rotate 24 hourly maxsize 10k compress ifempty postrotate reload rsyslog > /dev/null 2> & 1 || true endscript } I have copied ...
0
votes
1answer
3k views

How can I configure logrotate without having `/etc/logrotate.d/rsyslog`?

I am trying to configure log rotation on my Ubuntu machine so that logs are rotated every day and kept for 14 days. Most tutorials I find, such as this one, mention that I should modify /etc/logrotate....
3
votes
3answers
909 views

Why do only some of my logs get rotated?

I'm using Ubuntu 14.04. I have the following in my /etc/logrotate.conf file ... /home/rails/myproject/log { daily rotate 3 compress delaycompress missingok ...
0
votes
2answers
224 views

How to add custom logrotate configuration files to Ubuntu core?

Is there a way to add custom logrotate configuration files to Ubuntu core? /etc/logrotate.d is not writable. Should /writable/system-data/etc/logrotate.d be sourced? It doesn't seem to work and also ...
0
votes
2answers
740 views

Logrotate is deleting my logs

I have this logrotate config which is not in /etc/logrotate.d /path/to/my/logfile.log { su root root daily maxage 365000 copytruncate dateext dateformat -%d.%m.%Y } I run it ...
0
votes
0answers
382 views

How do I use logrotate to remove old log tarballs?

I'm using Ubuntu 14.04. I want to rotate log files daily, including deleting old tarballs. I edited my logrotate.conf file, /etc/logrotate.conf, like so /home/rails/myproject/log { daily ...
0
votes
0answers
1k views

Why logrotate is not running automatically in ubuntu 16.04?

I am on ubuntu 16.04 but from recent time I have seen complaints of very low system space. I tried to find and found that it was due to old log files so I find that the old files can be rotated as by ...
1
vote
1answer
172 views

Best ways to manipulate system logs

I want to manipulate logs. So far, for me the best way to clear system logs is: truncate -s 0 /var/log/*log I'm searching for the best ways to: 1 - Do the above periodically. I have already try ...
3
votes
2answers
4k views

MySQL logrotate error

I'm new to Linux and have setup a VPS running Ubuntu 16.04 with postfix, dovecot and rouncube using mariadb for the database. It all seem to be working okay but I regularly receive the following email:...
1
vote
1answer
498 views

logrotate - no such file or directory

Every morning I wake up to this e-mail from the Cron Daemon: /etc/cron.daily/logrotate: error: error accessing /var/log/ejabberd: No such file or directory error: ejabberd:1 glob failed for /var/log/...
2
votes
2answers
762 views

How to compress , keep and empty original file with gzip

For some reason I'm not being able to use logotate to compress files periodically. So I decided to write my own script, it's not the most hard thing but one small detail is pinning me down. When using ...
2
votes
1answer
12k views

Why is logrotate not running automatically?

I have set up a Syslog-ng server with some filters to split certain traffic into different files. I modified the logrotate file located at /etc/logrotate.d/syslog-ng to rotate these files daily, but ...
1
vote
0answers
538 views

Apache crashing with seg fault on a graceful restart on Ubuntu 14.04

One of the servers I manage runs Ubuntu 14.04.5 LTS with Apache 2.4.7 and PHP 7.0.11 , and uses PHP's Zend OPcache v7.0.11. It is noted that apache went down every time when we ran the service apache2 ...
2
votes
0answers
128 views

How to force log rotation more than one time in a day?

I'm trying to force the Apache logs rotations by executing sudo logrotate -f /etc/logrotate.d/apache2. When I executed the command for the first time, I get the logs rotated correctly. But if I ...
3
votes
0answers
750 views

how to make logrotate.d daily rotate each day at 00:00 exactly

I've followed the method shown at https://askubuntu.com/a/24526/498355 to make daily logrotate.d rotate at exactly 00:00. I have 2 physical servers which ubuntu 16.04 with the same date and timezone. ...
1
vote
1answer
2k views

Annoying access problem on /var/log/nginx

On my system (14.04), I'm not using www-data as the owner of nginx and php-fpm, using web instead. (for the curious: 1. because www-data is a ugly name, 2. for not using a user that everyone knows is ...
2
votes
2answers
1k views

Using logrotate to manage logs generated by PHP

My PHP scripts generate log files and I am trying to use logrotate to manage them. File /etc/logrotate.d/php-logs: /srv/cache/*.log { daily notifempty size 800K rotate 5 missingok ...
0
votes
2answers
363 views

How to make room in /var/log partition

Tracking ubuntu 14.04.3 firewall info I enabled ufw full login for a while (now turned back off). Now I'm warned I run out of space in the /var partition. Looking there in I find 3 huge files: kern....
2
votes
1answer
7k views

logrotate fails to rotate logs: error setting owner

Recently I've noticed that logrotate does not rotate my logs. user1@host:~$ /usr/sbin/logrotate /home/user1/logrotate.conf -v gives me an error: error: error setting owner of /home/logs/mylog.log.1 ...
1
vote
1answer
1k views

Logrotate - keep file for two days

Is there any possibility to configure logrotate so it will keep file for 2 days instead of 1? e.g. this configuration copytruncate daily compress dateext missingok leads to compressing file every ...
1
vote
1answer
3k views

How to change the day of the week Logrotate shifts the file when configured weekly?

I have following configuration which rotates all content of google folder weekly: /var/log/google/*.log { create 0777 www-data www-data weekly missingok rotate 90 ...
5
votes
1answer
10k views

/var/log/syslog not rotating

Our log file /var/log/syslog does not seem to be rotating, even though the logrotate config /etc/logrotate.d/rsyslog exists: /var/log/syslog { rotate 7 daily missingok notifempty ...
0
votes
2answers
4k views

How does logrotate work?

I am trying to monitor a log file which rotates frequently by logrotate. but i am unable to get that correctly. can any one explain how actually logrotate works? Is a file renamed and a new file is ...
1
vote
1answer
971 views

How do I identify which log is incorrectly rotated?

I'm receiving email prompts from two Ubuntu 14.04 servers around unusual logrotate behaviour. I don't have any packages installed which are not installed on other servers which don't exhibit this ...
0
votes
1answer
425 views

How can I configure logrotate to SCP multiple log files

I would like to copy multiple files form logrotate, so I try this : /var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log { daily rotate 7 ...
0
votes
1answer
244 views

Rotate binary files

I'm trying to solve a problem with rotating binary files. I have video files which are recorded from IP camera, and I want to delete oldest files when I have less then e.g. 10 Gb of free space. ...
6
votes
2answers
7k views

Nginx logrotate logs

I am running Ubuntu 15.04 and have a standard installation of nginx (apt-get install nginx) running. Everything is running fine but I notice that the nginx logs are being rotated but nginx carries on ...
1
vote
0answers
250 views

Apache daemon problem /etc/init.d/apache2

For the last 5 weeks, I have monitored some strange behavior. Every week at logrotate process time, the init script /etc/init.d/apache2 is being rotated as if it were a log file. The first week it ...
1
vote
0answers
256 views

Log rotate daily time for specific application

I know that similar question has been already asked, but there was something I am missing: Is there any option to specify the hour of rotating the logs, but only for one application ? I know that ...