logrotate is rotating all the rotations, how do I stop this?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# system-specific logs may be also be configured here.
/etc/http/logs/*log /etc/http/domlogs/*.log {
missingok
daily
size 100M
maxage 60
postrotate
/usr/bin/killall -HUP httpd
endscript
}
Your http server is seemingly already using dates as part of the file name based on the very last file in your list (the name includes November 1 as part of the name and that is also the date on the file). I would suggest that you take a different tact with those files...
Create a section SPECIFICALLY for that directory and those files. As part of that section, shut down the daemon cleanly, rotate out the file, make a new one, and then start the daemon back up. Additionally, I would suggest that you compress the files to save space, or at least compress ones over a certain age. Based on most of the files having no size, I suspect that you are not actually rotating the files out at all.
I'm thinking his part of the term is causing problems considering your file name structure:
Code:
/etc/http/logs/*log /etc/http/domlogs/*.log
Because it is not "STAR DOT log" it is "STAR log" which means files with log in the name.
Try adding an olddir term to your rotate.log. Make an /etc/httpd/rotated directory and then do something like this:
Code:
# system-specific logs may be also be configured here.
/etc/http/logs/*log /etc/http/domlogs/*.log {
missingok
olddir /etc/http/rotated
daily
size 100M
maxage 60
postrotate
/usr/bin/killall -HUP httpd
endscript
}
This will place your rotated files into the /etc/httpd/rotated directory.
If you also put in a "rotate #" term it will save that many backups, like "rotate 5" will append .1, .2, .3, .4, and .5 to files which get rotated. Note that 'rotate 0" will erase the file and start a new one.
Please also remember to place your code or comments within [code][/code] tags.
I was thinking similar, but **log does not mean the same as *log* (which would truly mean having "log" in the name as opposed to at the end). And, it would need to be the latter definition in order to rotate those with log only in the name.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.