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
0
votes
1 answer

Debian cron complaining about log dir ownership since upgrade to Wheezy

I'm getting errors from cron like this: /etc/cron.daily/logrotate: error: skipping "/var/log/apache2/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive…
artfulrobot
  • 2,949
  • 13
  • 36
  • 60
0
votes
1 answer

Best way to rotate Magento logs?

We have a lot of sites on Magento and the logs are getting gigantic, so I'm wondering if the best way is to use a cron script to rotate them or logrotate. I want to avoid making file copies as it junks up the folder and makes it hard to navigate, so…
user2344668
  • 361
  • 1
  • 2
  • 5
0
votes
2 answers

How should I rotate rsyslog documents stored in mysql

I have setup rsyslog to dump syslog data into mysql so that LogAnalyzer can easily access and interact with it. How do I automate a job to remove syslog data of a certain age for the mysql database so it doesn't fill my HD?
flickerfly
  • 2,753
  • 3
  • 25
  • 27
0
votes
3 answers

Why is logrotate not rotating logs Tomcat access logs on aws centos 6.3?

I have the following file in /etc/logrotate.d: /usr/share/apache-tomcat/logs/*.access { nodateext copytruncate daily rotate 7 notifempty postrotate EXT=`date --date='-1 day' +%Y-%m-%d` /bin/gzip $1.1 mv $1.1.gz $1.$EXT.log.gz endscript create 0640…
ashersz
  • 23
  • 1
  • 3
0
votes
1 answer

Hosts.deny file not being updated by denyhost service

I have denyhosts running on my server to block IPs that repeated fail to login over ssh, for example brute force style attacks. I can see that entries in the auth.log file have not been updated in the hosts.deny file for some time. How can I check…
niallhaslam
  • 101
  • 2
0
votes
1 answer

What actually calls logrotate in CentOS 6.3

What actually calls logrotate in CentOS 6.3? I looked inside of /etc/init.d but nothing related to logrotate there. Also, nothing in the crontab for the root user. Thanks.
Justin
  • 5,328
  • 19
  • 64
  • 84
0
votes
2 answers

Logrotater Daily situation

Every day I would like to run logrotate on /var/trafficap/captured/arch/ and zip all the zip packages I have for each day ( its 1 package.zip with a name like this : log_from_2012_08_14-11:57:12_To_2012_09_14-13:57:12.zip For each 2 hours of…
0
votes
2 answers

Logrotate, is this a proper config for what I want to do?

I started using logrotate a few days ago on a new server setup (actually three of them). My config is as follows. /var/www/mywebsite.com/logs/*.log { rotate 14 daily dateext compress delaycompress sharedscripts …
user84273
0
votes
1 answer

logrotate deletes all maillogs older than one day

I see only two files maillog and maillog.1 in /var/log. grepping for maillog in logrotate.d directory gives three files that have a mention of maillog. syslog /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log…
Abhijeet Rastogi
  • 236
  • 3
  • 20
0
votes
2 answers

Logrotate httpd (apache) logs - Possible without reloading httpd after log purge?

Lets start with a small dump: /var/log/httpd/*log { compress missingok notifempty sharedscripts delaycompress postrotate /sbin/service httpd reload > /dev/null 2>/dev/null || true endscript } This is a dump of of…
anonymous-one
  • 1,018
  • 7
  • 27
  • 43
0
votes
1 answer

logrotate not rotates my logs

My logrotate works perfectly, except for this configuration: /var/awdata/awarchive.*.log /var/log/awstats.log { rotate 12 } This is my logrotate -d /etc/logorate.conf output: considering log /var/awdata/awarchive.domain1.it.log log…
Roberto
  • 113
  • 5
0
votes
1 answer

Memcached logrotate file not being installed. Bug with memcached 1.4.2?

My memcached logs are getting huge (in excess of 5GB). This isn't a huge problem in itself. I can easily remove them. I've sourced the problem to the memcached 1.4.2 package not installing a logrotate file in /etc/logrotate.d/memcached. It's…
ScotterC
  • 101
  • 2
0
votes
1 answer

setting logrotate to use UTC time

Is it possible to force logrotate to use UTC time for one configuration? I need the dateext to be set to UTC. I was hoping it was as simple as setting a date varible. Should I just run postrotate and mv the files to a new file name that puts the UTC…
egorgry
  • 2,871
  • 2
  • 23
  • 21
0
votes
2 answers

Apache Log Rotation

Is there any mod or program for Apache Httpd which rotate logs as well as purge them without the restarting of server processes? I have checked a few options, mod_autorotate, rotatelogs, mod_log_rotate and cronologs. Scratched out mod_autorotate…
0
votes
2 answers

Logrotate won't rotate logs with a space

I have a log file a service of mine makes that has the filename "Feed1 - 1.stat". logrotate refuses to rotate this file, but only when run via cron. Running logrotate via the shell will rotate the file correctly. Changing the config and and log file…
Frederik
  • 153
  • 8