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

ansible task generating weird syntax for logrotate definition file

I am using ansible logrotate definition for logrotate in ubuntu 14.04 which is having definition as below --- - name: dependencies apt: pkg={{item}} state=latest with_items: - unzip - jq - name: check if already downloaded stat:…
Shailesh Sutar
  • 1,517
  • 5
  • 23
  • 41
-1
votes
1 answer

Passing shell command as part of logrotate olddir path

I'm trying to pass a custom formatted date as part of the olddir path in my logrotate configuration since I organize my archives chronologically (obviously!). This is what I'm passing to olddir : olddir /path/to/archive/$(date --date='-1 day'…
shine
  • 69
  • 1
  • 2
  • 4
-1
votes
1 answer

Continuous Log Rotation

I have implemented Log rotation as :- /data/mule/logs/*.log { rotate 1 size 20M missingok noolddir nomail notifempty create 644 root root compress } But the logs are not getting rotated continuously if the…
Arpit
  • 1
-1
votes
1 answer

Logrotate is not working centos 6.6

I have the following configuration for logrotating the app logs. /opt/tomcat/logs/app-web.txt { copytruncate daily size 500M compress delaycompress rotate 0 missingok notifempty } /opt/tomcat/logs has a lot of…
Vikash
  • 141
  • 4
-1
votes
2 answers

Logrotate not run

I use ubuntu 14.04 I try to run logrotate each 10min and remove all logs files bigger then 2MB, I try a lot solution but nothing not work, my logrotate run just 1 per day, I try solution with moved logrotate from cron.daily to cron.hourly but not…
nikola99
  • 101
  • 8
-1
votes
1 answer

use awk to execute logrotate command when disk is full

What I'm trying to do is manually run logrotate when my disk is greater than 90% full. I'm trying to do this using df -P and awk. I can get it to display the percentage, if it's > 90, but I can't quite figure out how to get awk to run logrotate -f…
-1
votes
1 answer

logrotate continuous write issue

i am having issues with logrotate rotating a log file that is being constantly written to. i am using copytruncate option and it gets the job done properly on first rotation but after that, all new rotations leave a file with binary data at the top…
h.i
  • 131
  • 2
-1
votes
1 answer

Web server stops logging

I have Virtual Hosts set up so that each VH has its own set of logs for access and errors. For some reason, these stop logging and returns to the default server logs randomly after logrotate kicks in but not always. Restarting the server resumes…
Ken
  • 109
  • 2
-1
votes
1 answer

specify multiple filenames in one line. bash

guys. im trying to add to logrotate files from a some directory. it should be either *.txt files or *_log files. wtat's the right syntax for…
Shirker
  • 579
  • 1
  • 5
  • 18
-1
votes
1 answer

CentOS 6.3: logrotate and btmp

I had to configure logrotate on a server configured by other system-network administration. First of all I detected that there is no crond, so I had to install sudo yum install vixie-cron. All other setup seems ok /etc/cron.daily/logrotate file…
happy_marmoset
  • 201
  • 2
  • 5
-1
votes
1 answer

Yesterday-access.log is pointing to a different directory

Under /var/log/ispconfig/httpd/quotednews.com/ folder, the yesterday-access.log is pointing to a wrong directory. yesterday-access.log is just a symlink to: /var/www/clients/client1/web2/log/20130626-access.log. The correct value should…
jaypabs
  • 823
  • 2
  • 10
  • 15
-1
votes
1 answer

Sending rotated files with syslog-ng

Hello I am currently sending the suricata logs from a probe to a Syslog-ng server(172.16.238.15): @version: 3.25 options { keep-timestamp (no); chain_hostnames (off); keep_hostname (no); }; source s_eve { wildcard-file( …
19mike95
  • 49
  • 5
-1
votes
2 answers

ESXi rotate logfiles by hours

ESXI: 70u2 Hi, I can't found "/etc/logrotate.conf", I understand he don't exist in this version. In the file "/etc/vmsyslog.conf" I can specify some options, the split by size has been for max but not for minimum. If the file don't grow to specific…
CH06
  • 13
  • 1
  • 5
-2
votes
1 answer

log files become to big

i use ubuntu 14.04 each 2 day i need manualy remove log files from: /var/log/apache2/domains 2 files become to big about 5gb, i found solution, edit logrotate.conf found in etc/logrotate.conf this is my logrorate.conf # see "man logrotate" for…
nikola99
  • 101
  • 8
-2
votes
2 answers

Compress files with logrotate

I have a directory structure which contains files already rotated (eg. there is a date part applied to the end). I would like to compress them and keep only 7 of each file type. Is this achievable with logrotate?
Istvan
  • 2,582
  • 3
  • 22
  • 29
1 2 3
29
30