1 # Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
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 #########################
17 option "config-file" c
18 #~~~~~~~~~~~~~~~~~~~~~
19 "(default='~/.adurc')"
20 string typestr="filename"
23 Options may be given at the command line or in the
24 configuration file. As usual, if an option is given both at
25 the command line and in the configuration file, the command
26 line option takes precedence.
36 Log messages are always written to stderr while normal output
37 goes to stdout. Lower values mean more verbose logging.
43 There are two ways to specify a database directory. You can either
44 specify a full path using the database-dir option or a root path
45 using the database-root option. In the latter case, a directory
46 structure matching that of the base-dir argument is created
47 below the given full path.
49 The advantage of using database-root is that the base-dir is
50 used to find the relevant database both in create and select mode
51 and you do not have to care for setting the database-dir explicitly.
54 groupoption "database-dir" d
55 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 "directory containing the osl tables"
60 Full path to the directory containing the osl tables. This
61 directory is created if it does not exist. It must be writable for the
62 user running adu in --create mode and readable in --select mode.
65 groupoption "database-root" r
66 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67 "directory containing directories containing the osl tables"
70 default="/var/lib/adu"
74 Base path to the directory containing the osl tables. The real
75 database-dir is generated by appending base-dir. This
76 directory is created if it does not exist. When used in select
77 mode you have to specify the base-dir as well.
87 adu may be started in one of three possible modes, each of
88 which corresponds to a different command line option. Exactly
89 one of these options must be given.
93 groupoption "create" C
94 #~~~~~~~~~~~~~~~~~~~~~
95 "Create a new database"
98 Traverse the given directory and track disk usage on a
99 per-user basis. Results are stored in N + 1 osl tables where
100 N is the number of uids that own at least one regular file
104 groupoption "interactive" I
105 #~~~~~~~~~~~~~~~~~~~~~~~~~~
106 "activate interactive mode"
109 In this mode, adu reads commands from stdin. This makes it
110 possible to run different select queries without opening the
111 underlying osl database for each query (which is expensive).
113 In interactive mode, several subcommands are available, see
114 the end of this document.
117 groupoption "select" S
118 #~~~~~~~~~~~~~~~~~~~~~
119 "query a database previously created with --create"
122 This option prints statistics about matching subdirectories
123 to stdout, to an output file or pipes the output to a given
124 command, depending on the --output option. The output format
125 can be customized by specifying select options, see below.
128 ##############################
129 section "Options for --create"
130 ##############################
134 "directory to traverse"
135 string typestr="path"
138 The base directory to be traversed recursively. A warning
139 message is printed for each subdirectory that could not be
140 read because of insufficient permissions. These directories
141 will be ignored when computing statistics.
144 option "one-file-system" x
145 #~~~~~~~~~~~~~~~~~~~~~~~~~
146 "do not dive into other file systems"
150 Skip directories that are on different file systems from the
151 one that the argument being processed is on.
154 option "hash-table-bits" -
155 #~~~~~~~~~~~~~~~~~~~~~~~~~
156 "specify the size of the uid hash table"
162 Use a hash table of size 2^num for the uid entries. If more than
163 2^num different uids own at least one regular file under base-dir,
164 the command fails. Increase this value if you have more than 1024
165 users. Decreasing the value causes adu to use slightly less memory.
168 option "bloom-filter-order" B
169 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170 "use bloom filters for hard link detection"
176 Allocate bloom filters of size 2^order bits. Each regular
177 file with hard link count greater than one is added to these
178 filters which allows to detect hard links on a per-user basis.
179 Greater values reduce the probability of false positives but
182 Values less than 10 deactivate this feature so that no hard
183 links are being detected.
186 option "num-bloom-filter-hash-functions" N
187 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188 "number of hash functions for the bloom filters"
194 Cause each entry which is added to the bloom filter to set
195 \"num\" bits of the bloom filter.
198 ##############################
199 section "Options for --select"
200 ##############################
202 option "select-options" s
203 #~~~~~~~~~~~~~~~~~~~~~~~~~
204 "Options for select mode"
205 string typestr="<options>"
209 This option takes a string whose content is another set of
210 options as described below. Select options may be specified
211 either directly in select mode, in which case you have use
212 quotes to prevent the select options from being interpreted
213 as adu options, or via the \"set\" command in interactive mode.