[ Next Article |
Previous Article |
Book Contents |
Library Home |
Legal |
Search ]
System Management Guide: Operating System and Devices
Compressing Files
Several methods exist for compressing a file system:
Files are compressed for the following reasons:
- Saving storage and archiving system resources:
- Compress file systems before making backups to preserve tape space.
- Compress log files created by shell scripts that run at night; it is easy to have the script compress the file before it exits.
- Compress files that are not currently being accessed. For example, the files belonging to a user who is away for extended leave can be compressed and placed into a tar archive on disk or to a tape and later restored.
- Saving money and time by compressing files before sending them over a network.
Procedure
To compress the foo file and write the percentage compression to standard error, enter:
compress -v foo
See the compress command for details
about the return values but, in general, the problems encountered when
compressing files can be summarized as follows:
- The command may run out of working space in the file system while compressing. Because the compress command creates the compressed files before it deletes any of the uncompressed files, it needs extra space-from 50% to 100% of the size of any given file.
- A file may fail to compress because it is already compressed. If the compress command cannot reduce the file size, it fails.
[ Next Article |
Previous Article |
Book Contents |
Library Home |
Legal |
Search ]