Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
4  
Yes - did you read the man page which includes examples of how to achieve these results? –  symcbean Jul 6 '12 at 23:20
add comment

closed as not a real question by symcbean, John Gardeniers, Wesley, Chris S Jul 22 '12 at 22:03

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Why not just add the compress option to your logrotate config file? Reinventing the wheel sucks.

share|improve this answer
add comment

I have decided to write a shell script instead of using logrotate for this purpose.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.