Is there a way to get logrotate to only compress files modified X number of days ago (e.g. mtime +2)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well you can use delaycompress to wait one more cycle. Basically if you rotate daily then it will keep yesterdays logs uncompressed.
Besides that you could try not using logrotate to compress the files and write a bash script to run like once a day and compress all files older than a certain date.
Here is a tutorial to bash that I personally like: http://www.linuxconfig.org/Bash_scripting_Tutorial