Merge branch 'master' into bloom
[adu.git] / adu.ggo
1 # Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
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 "config-file" c
18 #~~~~~~~~~~~~~~~~~~~~~
19 "(default='~/.adurc')"
20 string typestr="filename"
21 optional
22 details="
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.
27 "
28
29 option "database-dir" d
30 #~~~~~~~~~~~~~~~~~~~~~~
31 "directory containing the osl tables"
32 string typestr="path"
33 required
34 details="
35         Full path to the directory containing the osl tables. This
36         directory must exist. It must be writable for the user running
37         adu in --create mode and readable in --select mode.
38
39 "
40 option "loglevel" l
41 #~~~~~~~~~~~~~~~~~~
42 "Set loglevel (0-6)"
43 int typestr="level"
44 default="4"
45 optional
46 details="
47         Log messages are always written to stderr while normal output
48         goes to stdout. Lower values mean more verbose logging.
49 "
50
51 ###############
52 section "Modes"
53 ###############
54
55 defgroup "mode"
56 #==============
57 groupdesc="
58         adu may be started in one of three possible modes, each of
59         which corresponds to a different command line option. Exactly
60         one of these options must be given.
61
62 "
63 required
64
65 groupoption "create" C
66 #~~~~~~~~~~~~~~~~~~~~~
67 "Create a new database"
68 group="mode"
69 details="
70         Traverse the given directory and track disk usage on a
71         per-user basis. Results are stored in N + 1 osl tables where
72         N is the number of uids that own at least one regular file
73         in that directory.
74 "
75
76 groupoption "interactive" I
77 #~~~~~~~~~~~~~~~~~~~~~~~~~~
78 "activate interactive mode"
79 group="mode"
80 details="
81         In this mode, adu reads commands from stdin. This makes it
82         possible to run different select queries without opening the
83         underlying osl database for each query (which is expensive).
84
85         In interactive mode, several subcommands are available, see
86         the end of this document.
87 "
88
89 groupoption "select" S
90 #~~~~~~~~~~~~~~~~~~~~~
91 "query a database previously created with --create"
92 group="mode"
93 details="
94         This option prints statistics about matching subdirectories
95         to stdout, to an output file or pipes the output to a given
96         command, depending on the --output option. The output format
97         can be customized by specifying select options, see below.
98 "
99
100 ##############################
101 section "Options for --create"
102 ##############################
103
104 option "base-dir" b
105 #~~~~~~~~~~~~~~~~~~
106 "directory to traverse"
107 string typestr="path"
108 dependon="create"
109 optional
110 details="
111         The base directory to be traversed recursively. A warning
112         message is printed for each subdirectory that could not be
113         read because of insufficient permissions. These directories
114         will be ignored when computing statistics.
115 "
116
117 option "one-file-system" x
118 #~~~~~~~~~~~~~~~~~~~~~~~~~
119 "do not dive into other file systems"
120 flag off
121 dependon="create"
122 details="
123         Skip directories that are on different file systems from the
124         one that the argument being processed is on.
125 "
126
127 option "hash-table-bits" -
128 #~~~~~~~~~~~~~~~~~~~~~~~~~
129 "specify the size of the uid hash table"
130 int typestr="num"
131 dependon="create"
132 default="10"
133 optional
134 details="
135         Use a hash table of size 2^num for the uid entries. If more than
136         2^num different uids own at least one regular file under base-dir,
137         the command fails. Increase this value if you have more than 1024
138         users. Decreasing the value causes adu to use slightly less memory.
139 "
140
141 option "bloom-filter-order" B
142 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143 "use bloom filters for hard link detection"
144 int typestr="order"
145 dependon="create"
146 default="23"
147 optional
148 details="
149         Allocate bloom filters of size 2^order bits. Each regular
150         file with hard link count greater than one is added to these
151         filters which allows to detect hard links on a per-user basis.
152         Greater values reduce the probability of false positives but
153         require more memory.
154
155         Values less than 10 deactivate this feature so that no hard
156         links are being detected.
157 "
158
159 option "num-bloom-filter-hash-functions" N
160 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161 "number of hash functions for the bloom filters"
162 int typestr="num"
163 dependon="create"
164 default="10"
165 optional
166 details="
167         Cause each entry which is added to the bloom filter to set
168         \"num\" bits of the bloom filter.
169 "
170
171 ##############################
172 section "Options for --select"
173 ##############################
174
175 option "select-options" s
176 #~~~~~~~~~~~~~~~~~~~~~~~~~
177 "Options for select mode"
178 string typestr="<options>"
179 optional
180 dependon="select"
181 details="
182         This option takes a string whose content is another set of
183         options as described below. Select options may be specified
184         either directly in select mode, in which case you have use
185         quotes to prevent the select options from being interpreted
186         as adu options, or via the \"set\" command in interactive mode.
187 "