643bbbff618728a865fd779aa29c363812b40f3c
[adu.git] / adu.ggo
1 # Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
2 #
3 # Licensed under the GPL v2. For licencing details see COPYING.
4
5 package "adu"
6 purpose "
7
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.
11 "
12
13 #########################
14 section "General options"
15 #########################
16
17 option "loglevel" l
18 #~~~~~~~~~~~~~~~~~~
19 "Set loglevel (0-6)"
20 int typestr="level"
21 default="4"
22 optional
23 details="
24         Log messages are always written to stderr while normal output
25         goes to stdout. Lower values mean more verbose logging.
26 "
27
28 defgroup "database"
29 #==================
30 groupdesc="
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.
36
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.
40 "
41
42 groupoption "database-dir" d
43 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 "directory containing the osl tables"
45 group="database"
46 string typestr="path"
47 details="
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.
51 "
52
53 groupoption "database-root" r
54 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 "directory containing directories containing the osl tables"
56 group="database"
57 string typestr="path"
58 default="/var/lib/adu"
59 dependon="base-dir"
60 optional
61 details="
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.
66 "
67
68 ###############
69 section "Modes"
70 ###############
71
72 defgroup "mode"
73 #==============
74 groupdesc="
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.
78 "
79 required
80
81 groupoption "create" C
82 #~~~~~~~~~~~~~~~~~~~~~
83 "Create a new database"
84 group="mode"
85 details="
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
89         in that directory.
90 "
91
92 groupoption "interactive" I
93 #~~~~~~~~~~~~~~~~~~~~~~~~~~
94 "activate interactive mode"
95 group="mode"
96 details="
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).
100
101         In interactive mode, several subcommands are available, see
102         the end of this document.
103 "
104
105 groupoption "select" S
106 #~~~~~~~~~~~~~~~~~~~~~
107 "query a database previously created with --create"
108 group="mode"
109 details="
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.
114 "
115
116 ##############################
117 section "Options for --create"
118 ##############################
119
120 option "base-dir" b
121 #~~~~~~~~~~~~~~~~~~
122 "directory to traverse"
123 string typestr="path"
124 optional
125 details="
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.
130 "
131
132 option "one-file-system" x
133 #~~~~~~~~~~~~~~~~~~~~~~~~~
134 "do not dive into other file systems"
135 flag off
136 dependon="create"
137 details="
138         Skip directories that are on different file systems from the
139         one that the argument being processed is on.
140 "
141
142 option "hash-table-bits" -
143 #~~~~~~~~~~~~~~~~~~~~~~~~~
144 "specify the size of the uid hash table"
145 int typestr="num"
146 dependon="create"
147 default="10"
148 optional
149 details="
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.
154 "
155
156 option "bloom-filter-order" B
157 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158 "use bloom filters for hard link detection"
159 int typestr="order"
160 dependon="create"
161 default="23"
162 optional
163 details="
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
168         require more memory.
169
170         Values less than 10 deactivate this feature so that no hard
171         links are being detected.
172 "
173
174 option "num-bloom-filter-hash-functions" N
175 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 "number of hash functions for the bloom filters"
177 int typestr="num"
178 dependon="create"
179 default="10"
180 optional
181 details="
182         Cause each entry which is added to the bloom filter to set
183         \"num\" bits of the bloom filter.
184 "
185
186 ##############################
187 section "Options for --select"
188 ##############################
189
190 option "select-options" s
191 #~~~~~~~~~~~~~~~~~~~~~~~~~
192 "Options for select mode"
193 string typestr="<options>"
194 optional
195 dependon="select"
196 details="
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.
202 "