1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
=head1 NAME
durep - disk usage report generator
=head1 SYNOPSIS
durep [OPTIONS]... [DIRECTORY]
=head1 DESCRIPTION
B<durep> creates disk usage reports with bar graphs, allowing one to
easily deduce which directories are using the most space. Although
B<durep> can produce text output similar to du, its real power lies in
the ability to store reports in a file, which can then be viewed as a
web page with the supplied cgi script.
=head1 OPTIONS
Options are grouped into three distinct sections.
=head2 Text Output Options
These options are for controlling the text report output.
=over 7
=item B<-td, --text-depth>=I<N>
Limit text report on directories to depth I<N>. No directories below
this level will be shown in the report.
=item B< -hs, --hide-size>=I<N[bkmg]>
Do not display entries using I<N> Bytes/KB/MB/GB or less (default
Bytes). This is to reduce clutter in the reports. It allows you to
remove small files from the text report.
=item B< -sd, --show-date>
Display the modification date of the file or directory in the report.
=item B<-ns, --nosort>
Do not sort results by size. Leaves results in the order in which they
were scanned, which is highly dependent on the file system.
=item B<-q, --quiet>
Do not produce text output. This stops the creation of a text report,
and is useful when you are only interested in generating a save-file
for use with the web report.
=back
=head2 File Options
These options control load and save files.
=over 7
=item B<-sf, --save-file>=I<FILE>
Save the results of the scan into this file. This can be loaded for a
text report, but is generally used by the cgi script to display web
reports. The filename should end in I<.ds> (it is appended if it does
not).
=item B<-lf, --load-file>=I<FILE>
Load the results of a scan from this file. This takes the place of
scanning a directory. Inclusion options (described below) will not
take effect if this option is used.
=item B<-d, --desc>=I<DESCRIPTION>
Give a description to be stored in the save-file. This is displayed on
the web report summary page.
=item B<-c, --collate=>=I<DIR>
Collate the save-files in the given directory. This creates a
I<durep.cds> file, which is used by the cgi script to manage and
display save-files. See B<Web Reports> section below for more detail.
=back
=head2 Inclusion Options
These options control which directories and files should be included in the report.
=over 7
=item B<-f, --files>
Do not descend into sub-directories, only report files.
=item B<-x, --one-file-system>
Do not traverse file systems. This is similar to the B<-x> option for
du, allowing easy checking of an entire file system such as /.
=item B<-cp, --collapse-path=>I<PATTERN>
Hide entries below paths that match I<PATTERN>. This allows you to
conceal the contents of certain directories in the report. You may
wish perhaps to show home directories in a report but not show their
content in which case you could use the option C<-cp
'/home'>.
=item B<-ep, --exclude-path>=I<PATTERN>
Ignore paths that match I<PATTERN>. This works in a similar manner to
C<-cp> above, except it excludes the directory from the scan itself.
=item B<-cf, --coalesce-files=>=I<N[bkmg]>
Coalesces entries for files below the given size into one entry. This
is useful for reducing clutter in reports.
=back
=head1 WEB REPORTS
Since version 0.9, durep no longer directly generates html files for
its web reports. It now uses a cgi script that reads data from
save-files. The script will handle multiple save-files, potentially
from multiple hosts, so you can consolidate your reports into one
place. Copying save-files from other hosts is left as an exercise for
the reader.
It is necessary to collate the save-files before viewing them via the
cgi script. This process creates the file C<durep.cds> which contains
meta-data about all of the save-files. From this a summary page is
shown where you can choose which report you wish to view. The
collation must be done any time a save-file is added or overwritten.
The cgi-script has some configurable variables at the top. These tell
the script where to look for the css file and the graphic used for the
bar graphs. There are also options to set whether the modification
date, and/or the options used to create the save-file should be
shown. These are both set to 1 by default.
As always, you should take care when installing the cgi script. I've
done my best, but I make no guarantees about its security. It would
probably be unwise to allow this script to be accessed from the
Internet at large.
=head1 EXAMPLES
=over 3
=item 1.
B<durep -td 2>
This would print the directory tree starting from the current
directory to depth 2.
=item 2.
B<durep -f /var/spool/mail>
This might be useful for keeping a check on the mail directory. The
C<-f> switch tells durep to just scan files and not descend into
directories.
=item 3.
B<durep -x -cp "/(etc|usr/share)" -ep "/var" -sf /var/lib/durep/root.ds />
This more complicated version does the following. It scans the root
file system only, collapses the contents of any paths beginning F</etc>
or F</usr/share> and skips the contents of the F</var> directory. It
saves the output of this report into the file
I</var/lib/durep/root.ds>. No text report is produced.
=item 4.
B<durep -lf /var/lib/durep/root.ds -hs 1m>
This reads the save-file I</var/lib/durep/root.ds> and produces a text
report from it, hiding any files below 1 megabyte.
=item 5.
B<durep -c /var/lib/durep>
This collates any save-files in I</var/lib/durep>.
=back
=head1 SEE ALSO
du(1), perl(1)
=head1 AUTHOR
Damian Kramer E<lt>psiren@hibernaculum.netE<gt>
|