Specifications
5-11
Troubleshooting the Base Operating System Spooler
Deleting Unnecessary Directory Files
Use the following procedures to clean out unnecessary files stored in the spooling directory.
Note: Some commands require root user or system group authority.
1. Determine if there are unnecessary files stored in the spooling directory by entering the
following du command:
du –rs /var/spool
The du command summarizes disk usage. The –s flag instructs the du command to
display only the total disk usage of the /var/spool directory and the files it contains. The
–r flag tells the du command to display an error message if it cannot read a file or
directory.
2. Delete or move files in a full directory by doing either of the following:
– Delete any extraneous files. For example:
rm extrafile
– Move files that are a few hours old to a safe temporary directory. For example:
mv extrafile /u/spoolhold
Note: You must have root user authority to remove or move files other than your
own.
3. Prevent users from storing files in your spooling directories by doing the following:
– Set permissions on the spooling directory using the chmod command. Change the
directory to exclude general users. For example:
chmod go–rw /var/spool/lp0
– Create a cron job to clean out the directory (you must have root user authority). Edit
the crontab file. For example, you might add the following line to your crontab file:
find /spool –mtime +7 –a –exec rm –f
This line removes any file in the /var/spool directory one week after the last
modification.
For more information about creating cron jobs and using the crontab command, see
”How to Set Up an Accounting System” in AIX 5L Version 5.3 System Management
Guide: Operating System and Devices.
– Establish policy for the whole user group.
For example, use e–mail to make a general announcement or add to the message of
the day (/etc/motd) asking users to clean up their files. To change the message of
the day, see ”How to Change the Message of the Day” in AIX 5L Version 5.3 System
Management Guide: Operating System and Devices.
Create a script to identify all users whose disk holdings are above a certain threshold
and send them e–mail requesting that they clean up their files.
– Provide an alternate way to store files, such as a tape drive in a public area, so users
can archive infrequently used files.
4. As a last resort, mount more space to the spool directory by using one of the following
methods:
– Use the mount command, which makes a file system available for use at a specified
location. For example:
mount /var/spool morespool
– Use the smit mount command, choose the Mount a File System option, and specify
the file system name and attributes.