Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

Yes - did you read the man page which includes examples of how to achieve these results? – symcbean Jul 6 '12 at 23:20

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

share|improve this answer

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

share|improve this answer

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