Questions tagged [logrotate]

logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

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 and logrotate is being run multiple times each day, or unless the -f or -force option is used.

Any number of config files may be given on the command line. Later con- fig files may override the options given in earlier files, so the order in which the logrotate config files are listed in is important. Nor- mally, a single config file which includes any other config files which are needed should be used. See below for more information on how to use the include directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file.

If no command line arguments are given, logrotate will print version and copyright information, along with a short usage summary. If any errors occur while rotating logs, logrotate will exit with non-zero status.

AUTHORS

   Erik Troan 
   Preston Brown 
436 questions
2
votes
1 answer

Apache outputting without .log

I am trying to fix an issue where an apache log is filling the /var/log/ partition. It is a single log in apache2 that is almost 4GB. I have set logrotate to rotate out at 3G, but it has not rotated the log. Additionally, the logrotate looks like…
Anath3ma
  • 25
  • 5
2
votes
0 answers

Logrotate not rotating without size config

On RedHat, I have a logrotate configuration as follows : /custom/path/kibana/logs/*.log { missingok daily create 0644 suuser suuser rotate 7 notifempty sharedscripts compress dateext dateformat -%Y%m%d%s su suuser suuser …
Pierre
  • 21
  • 1
2
votes
1 answer

Logrotate isn't deleting old files

I have a daily backup running using logrotate. I don't have root access to this machine to edit the normal logrotate.conf, therefore I'm calling it via crontab like so: 0 4 * * * /usr/sbin/logrotate /home/myuser/backups/logrotate.conf --state…
robertmain
  • 123
  • 3
2
votes
1 answer

Logrotate: glob finding old rotated logs failed

I am having problems with logrotate. The configuration is the following /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/unused.log /var/log/kern.log /var/log/daemon.log { #Modified by CGSL! …
AndresM
  • 39
  • 1
  • 1
  • 5
2
votes
2 answers

Two scripts in /etc/cron.daily seem to be rotating my logs: logrotate and sysklogd

It seems that my logfiles generated by syslog are getting rotated twice each day. I believe this is due to both /etc/cron.daily/logrotate and /etc/cron.daily/sysklogd doing overlapping work. Here are the relevant lines from the sysklogd…
mike
  • 3,963
  • 11
  • 30
  • 27
2
votes
0 answers

What happens when svnserve gets stopped (SIGKILLED) while a commit is in progress?

What happens when svnserve gets stopped (SIGKILLed) while a commit [to an FSFS repository] is in progress ? (I mean has svnserve been made robust enough to handle this, say upon restart, or must the repositories all be considered corrupted…
Erwin Smout
  • 121
  • 2
2
votes
1 answer

awslinux /etc/cron.daily doesn't execute logrotate file

sorry about low level english IN MY STAGING SERVER I want logrotate every day(nginx) so I create logrotate file in /etc/logrotate.d/ /etc/logrotate.d/nginx /var/log/nginx/*log { create 0644 nginx nginx daily rotate 30 missingok …
Jade Han
  • 133
  • 2
  • 5
2
votes
1 answer

Logrotate postrotate: Log file name variable empty

According to the logrotate manual (https://manpages.debian.org/jessie/logrotate/logrotate.8.en.html), logrotate should invoke a script and hand over the filename of the rotated file as the first parameter of the script with this…
hey
  • 327
  • 1
  • 5
  • 14
2
votes
2 answers

How does one keep a file's timestamp (date modified) after a logrotate?

Title says it all, I have a log rotate set up daily for some rather large log files. Sometimes we can generate 3 of these a day, sometimes we only generate 1, they're each about 500MB. Is there a way to keep date modified of the file after a log…
T Jones
  • 21
  • 2
2
votes
1 answer

Logrotate maxsize with minsize

I wonder if maxsize and minsize can both be added with a specified time interval and can thus coexist. With these options both the size and timestamp of a log file are considered, so if it happens that a log file grows bigger than maxsize just…
Asarluhi
  • 151
  • 2
  • 6
2
votes
1 answer

logrotate prerotate script not getting name of file to be rotated

I am having trouble with the prerotate script in logrotate 3.12.2. The script I specify in the prerotate/endscript section is not receiving the name of the file to be rotated as the first argument ($1). Here is the logrotate…
user35042
  • 2,681
  • 12
  • 34
  • 60
2
votes
2 answers

error: error creating unique temp file: Permission denied

while executing logrotate script manually I am receiving an error as follows. $ logrotate -vf /apps/web/scripts/Logroate-web.conf truncating /apps/oracle/admin/mserver/adf12dev/servers/adf_1/logs/udara_1.out set default create context error: error…
Vivo
  • 21
  • 2
2
votes
1 answer

logrotate configuration on linux to rotate syslog-ng log files correctly

I am having some trouble trying to configure log rotation for some syslog-ng local log files I'm trying to keep. for some reason, the size is not respected and logs are filling my filesystem quickly. I want to keep something like 3 files of 100Mbs…
olivierg
  • 524
  • 2
  • 8
  • 27
2
votes
1 answer

mysql root password - where should it be stored?

Where is the best place to store the mysql root password? I had been putting it only in the root user's /root/.my.cnf file, which works fine for doing normal updates, backups, etc. However, the (debian)/ubuntu logrotate script (for instance) doesn't…
Daniel
  • 180
  • 3
  • 7
2
votes
0 answers

Logrotation permissions troubles

I think I have a mess with the log files on one of my Ubuntu servers and need advice + recipes on how to repair this. I am seeing lots of errors like these when log rotation occurs: error: failed to rename /var/log/dovecot.log to…