Showing posts with label rotate. Show all posts
Showing posts with label rotate. Show all posts

Wednesday, June 5, 2013

Rotating Log Files




This script moves on log files listed on the command line. It keeps all but the most recent onecompressed, and removes the last one once there are more than CYCLES of them. For example,CYCLES=3 ; rotate messages Would have the following effects.messages --> messages.1messages.1 --> messages.2.gzmessages.2.gz --> messages.3.gzmessages.3.gz --> removed