FSSTATS(1) User Contributed Perl Documentation FSSTATS(1) NAME fsstats - Collect statistics about a filesystem SYNOPSIS fsstats [options] dir [dir ...] DESCRIPTION Walk a file tree and gather statistics about it. Currently we collect the following pieces of information: · file size · file capacity used · directory size (number of entries & KB) · filename length · symlink target length · number of hardlinks · file age (by file and by KB) The script intentionally uses only standard POSIX calls to obtain information about the underlying filesystem. This limits the information which can be collected, but maximizes portability. Output can be produced in three formats: 1. Plain text format, printed to stdout. 2. A comma-separated value (CSV) file, suitable for spreadsheet import or further processing by another script. 3. A checkpoint file that records the internal state of the program, for restarting later or directly importing the data into another Perl script. Options -c ckptfile Write a checkpoint file to ckptfile when exiting normally. Without this option, a checkpoint is only generated if fsstats exits prematurely. This file is also used for the periodic checkpoints if -i ckpt_interval is specified. -h Print help, then exit. -i ckpt_interval Specify the interval (in minutes) between periodic checkpoints. The default is 10 minutes. Setting ckpt_interval to 0 disables periodic checkpoints. -o outfile Write comma-separated value (CSV) output to outfile when exiting normally. (Default is to print this to stdout.) -r ckptfile Read initial state from ckptfile. With this option, any directories specified on the command line are ignored in favor of the list of directories in the checkpoint. -s Print detailed timing statistics. Requires the "Time::HiRes" module. -v Verbose mode. Print incremental text-mode results in every periodic status message. EXAMPLES Collect filesystem statistics for the /usr1 heirarchy, printing results on stdout: fsstats /usr1 Restart from a checkpoint file, writing output in CSV format to /tmp/usr1.csv: fsstats -r /tmp/fsstats.abc123 -o /tmp/usr1.csv CAVEATS If your perl was compiled without 64-bit integer support, files larger than 4 GB will not be tabulated correctly. This is a limitation of the "stat"/"lstat" calls built into perl, so there is no way to work around it from the script. fsstats will print a warning if it detects it is running in a perl interpreter without 64-bit int support. To enable printing "statvfs" information about the filesystem, you will need to install the "Filesys::Statvfs" module. It is available from CPAN (http://search.cpan.org/~iguthrie/Filesys-Statvfs_Statfs_Df-0.75/). To use the -s option, you will need to install the "Time::HiRes" module, which may be packaged with your OS distribution and is also available from CPAN.