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 "database-dir" d
18 #~~~~~~~~~~~~~~~~~~~~~~
19 "directory containing the osl tables"
23 Full path to the directory containing the osl tables. This
24 directory must exist. It must be writable for the user running
25 adu in --create mode and readable in --select mode.
35 Log messages are always written to stderr while normal output
36 goes to stdout. Lower values mean more verbose logging.
46 adu may be started in one of three possible modes, each of
47 which corresponds to a different command line option. Exactly
48 one of these options must be given.
53 groupoption "create" C
54 #~~~~~~~~~~~~~~~~~~~~~
55 "Create a new database"
58 Traverse the given directory and track disk usage on a
59 per-user basis. Results are stored in N + 1 osl tables where
60 N is the number of uids that own at least one regular file
64 groupoption "interactive" I
65 #~~~~~~~~~~~~~~~~~~~~~~~~~~
66 "activate interactive mode"
69 In this mode, adu reads commands from stdin. This makes it
70 possible to run different select queries without opening the
71 underlying osl database for each query (which is expensive).
73 In interactive mode, several subcommands are available, see
74 the end of this document.
77 groupoption "select" S
78 #~~~~~~~~~~~~~~~~~~~~~
79 "query a database previously created with --create"
82 This option prints statistics about matching subdirectories
83 to stdout, to an output file or pipes the output to a given
84 command, depending on the --output option. The output format
85 can be customized by specifying select options, see below.
88 ##############################
89 section "Options for --create"
90 ##############################
94 "directory to traverse"
99 The base directory to be traversed recursively. A warning
100 message is printed for each subdirectory that could not be
101 read because of insufficient permissions. These directories
102 will be ignored when computing statistics.
105 option "one-file-system" x
106 #~~~~~~~~~~~~~~~~~~~~~~~~~
107 "do not dive into other file systems"
111 Skip directories that are on different file systems from the
112 one that the argument being processed is on.
115 option "hash-table-bits" -
116 #~~~~~~~~~~~~~~~~~~~~~~~~~
117 "specify the size of the uid hash table"
123 Use a hash table of size 2^num for the uid entries. If more than
124 2^num different uids own at least one regular file under base-dir,
125 the command fails. Increase this value if you have more than 1024
126 users. Decreasing the value causes adu to use slightly less memory.
129 option "bloom-filter-order" B
130 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131 "use bloom filters for hard link detection"
137 Allocate bloom filters of size 2^order bits. Each regular
138 file with hard link count greater than one is added to these
139 filters which allows to detect hard links on a per-user basis.
140 Greater values reduce the probability of false positives but
143 Values less than 10 deactivate this feature so that no hard
144 links are being detected.
147 option "num-bloom-filter-hash-functions" N
148 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149 "number of hash functions for the bloom filters"
155 Cause each entry which is added to the bloom filter to set
156 \"num\" bits of the bloom filter.
159 ##############################
160 section "Options for --select"
161 ##############################
163 option "select-options" s
164 #~~~~~~~~~~~~~~~~~~~~~~~~~
165 "Options for select mode"
166 string typestr="<options>"
170 This option takes a string whose content is another set of
171 options as described below. Select options may be specified
172 either directly in select mode, in which case you have use
173 quotes to prevent the select options from being interpreted
174 as adu options, or via the \"set\" command in interactive mode.