Logrotate help!
#1
Posted 10 February 2012 - 11:11 AM
09:59:24 # ls /var/log -l | grep haproxy
-rw------- 1 root root 0 Feb 10 04:02 haproxy.log
-rw------- 1 root root 75117061 Feb 10 09:59 haproxy.log-20120210
The second file below is the one growing in size with each transaction going through our system. I want the FIRST one to be where current transactions go.
Here is my logrotate script, placed in of course /etc/logrotate.d/haproxy :
/var/log/haproxy.log {
daily
rotate 1000
dateext
}
What am I doing wrong? Logrotate is already set as a daily cron job.
#2
Posted 11 February 2012 - 10:45 AM
Hello. I implemented a logrotate script for haproxy on our servers, and it seems it is not doing the behavior I had hoped for. Let me explain:
09:59:24 # ls /var/log -l | grep haproxy
-rw------- 1 root root 0 Feb 10 04:02 haproxy.log
-rw------- 1 root root 75117061 Feb 10 09:59 haproxy.log-20120210
The second file below is the one growing in size with each transaction going through our system. I want the FIRST one to be where current transactions go.
Here is my logrotate script, placed in of course /etc/logrotate.d/haproxy :
/var/log/haproxy.log {
daily
rotate 1000
dateext
}
What am I doing wrong? Logrotate is already set as a daily cron job.
The daily line in your logrotate config file will make logrotate create a new file with the date at the end every day. After looking at the man page i could not find "dateext", but I imagine it is a correct value in your version of logrotate. I would think that dateext means that the log file is saved with the date as the extension... You need to take a look at the log rotate man page if you plan to fix your problem.
Not really sure how you plan to have someone else fix this for you... just follow the man page.
http://linuxcommand.org/man_pages/logrotate8.html
#3
Posted 12 February 2012 - 12:06 PM
#4
Posted 12 February 2012 - 04:28 PM
BinRev is hosted by the great people at Lunarpages!











