O'Reilly logo

Shell Scripting Recipes: A Problem-Solution Approach, Second Edition by Jayant Varma, Chris F. A. Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 11

image

Aging, Archiving, and Deleting Files

Files grow. It’s a fact of life. There are log files in /var/log (they may be in /var/adm, or somewhere else, depending on your system). In my mail directory I have saved-messages, and sent-mail, and files for the various mailing lists I’m on. In my Chess directory, fics.pgn stores every game of chess I play online. Files in my News directory swell with my Usenet posts.

Most modern Unix systems offer a log rotation program that can be configured to suit many of your needs. Files can be rotated daily, weekly, monthly, or whenever they reach a certain size. They can be compressed or not, as you wish. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required