1 # Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
3 # Licensed under the GPL v2. For licencing details see COPYING.
8 adu creates a database containing disk usage statistics of a given
9 directory. It allows to query that database to quickly retrieve
10 usage patterns of subdirectories and/or files owned by a given user id.
13 #########################
14 section "General options"
15 #########################
24 Log messages are always written to stderr while normal output
25 goes to stdout. Lower values mean more verbose logging.
31 There are two ways to specify a database directory. You can either
32 specify a full path using the database-dir option or a root path
33 using the database-root option. In the latter case, a directory
34 structure matching that of the base-dir argument is created
35 below the given full path.
37 The advantage of using database-root is that the base-dir is
38 used to find the relevant database both in create and select mode
39 and you do not have to care for setting the database-dir explicitly.
42 groupoption "database-dir" d
43 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 "directory containing the osl tables"
48 Full path to the directory containing the osl tables. This
49 directory is created if it does not exist. It must be writable for the
50 user running adu in --create mode and readable in --select mode.
53 groupoption "database-root" r
54 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 "directory containing directories containing the osl tables"
58 default="/var/lib/adu"
62 Base path to the directory containing the osl tables. The real
63 database-dir is generated by appending base-dir. This
64 directory is created if it does not exist. When used in select
65 mode you have to specify the base-dir as well.
75 adu may be started in one of three possible modes, each of
76 which corresponds to a different command line option. Exactly
77 one of these options must be given.
81 groupoption "create" C
82 #~~~~~~~~~~~~~~~~~~~~~
83 "Create a new database"
86 Traverse the given directory and track disk usage on a
87 per-user basis. Results are stored in N + 1 osl tables where
88 N is the number of uids that own at least one regular file
92 groupoption "interactive" I
93 #~~~~~~~~~~~~~~~~~~~~~~~~~~
94 "activate interactive mode"
97 In this mode, adu reads commands from stdin. This makes it
98 possible to run different select queries without opening the
99 underlying osl database for each query (which is expensive).
101 In interactive mode, several subcommands are available, see
102 the end of this document.
105 groupoption "select" S
106 #~~~~~~~~~~~~~~~~~~~~~
107 "query a database previously created with --create"
110 This option prints statistics about matching subdirectories
111 to stdout, to an output file or pipes the output to a given
112 command, depending on the --output option. The output format
113 can be customized by specifying select options, see below.
116 ##############################
117 section "Options for --create"
118 ##############################
122 "directory to traverse"
123 string typestr="path"
126 The base directory to be traversed recursively. A warning
127 message is printed for each subdirectory that could not be
128 read because of insufficient permissions. These directories
129 will be ignored when computing statistics.
132 option "one-file-system" x
133 #~~~~~~~~~~~~~~~~~~~~~~~~~
134 "do not dive into other file systems"
138 Skip directories that are on different file systems from the
139 one that the argument being processed is on.
142 option "hash-table-bits" -
143 #~~~~~~~~~~~~~~~~~~~~~~~~~
144 "specify the size of the uid hash table"
150 Use a hash table of size 2^num for the uid entries. If more than
151 2^num different uids own at least one regular file under base-dir,
152 the command fails. Increase this value if you have more than 1024
153 users. Decreasing the value causes adu to use slightly less memory.
156 option "bloom-filter-order" B
157 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158 "use bloom filters for hard link detection"
164 Allocate bloom filters of size 2^order bits. Each regular
165 file with hard link count greater than one is added to these
166 filters which allows to detect hard links on a per-user basis.
167 Greater values reduce the probability of false positives but
170 Values less than 10 deactivate this feature so that no hard
171 links are being detected.
174 option "num-bloom-filter-hash-functions" N
175 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 "number of hash functions for the bloom filters"
182 Cause each entry which is added to the bloom filter to set
183 \"num\" bits of the bloom filter.
186 ##############################
187 section "Options for --select"
188 ##############################
190 option "select-options" s
191 #~~~~~~~~~~~~~~~~~~~~~~~~~
192 "Options for select mode"
193 string typestr="<options>"
197 This option takes a string whose content is another set of
198 options as described below. Select options may be specified
199 either directly in select mode, in which case you have use
200 quotes to prevent the select options from being interpreted
201 as adu options, or via the \"set\" command in interactive mode.