Next | Prev | Up | Top | Contents | Index

Monitoring Key Files and Directories

Almost any system that is used daily has several key files and directories that grow through normal use. Some examples are shown in Table 5-2.

Files and Directories That Tend to Grow
FileUse
/etc/wtmp history of system logins
/tmp directory for temporary files (Root filesystem)
/var/adm/avail/availlog log file for the availabilility monitor (see the availmon(5) reference page)
/var/adm/avail/notifyloglog file for the availabilility monitor (see the availmon(5) reference page)
/var/adm/sulog history of su commands
/var/cron/log history of actions of cron
/var/spool/lp/log history of actions of lp
/var/spool/uucp directory for uucp log files
/var/tmp directory for temporary files

The frequency with which you should check growing files depends on how active your system is and how critical the disk space problem is. A good technique for keeping them down to a reasonable size uses a combination of the tail and mv commands:

# tail -50 /var/adm/sulog > /var/tmp/sulog 
# mv /var/tmp/sulog /var/adm/sulog 
This sequence puts the last 50 lines of /var/adm/sulog into a temporary file, then moves the temporary file to /var/adm/sulog. This reduces the file to the 50 most recent entries. It is often useful to have these commands performed automatically every week using cron. For more information on using cron to automate your regular tasks, see the cron(1M) reference page.


Next | Prev | Up | Top | Contents | Index