]> git.tuebingen.mpg.de Git - adu.git/blob - adu.ggo
1d0729d1714fde2dc8007c2abdc534eb02843cb7
[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 "advanced disk usage
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
30 option "database-dir" d
31 #~~~~~~~~~~~~~~~~~~~~~~
32 "directory containing the osl tables"
33 string typestr="path"
34 required
35 details="
36         Full path to the directory containing the osl tables. This
37         directory must exist. It must be writable for the user running
38         adu in --create mode and readable in --select mode.
39
40 "
41 option "loglevel" l
42 #~~~~~~~~~~~~~~~~~~
43 "Set loglevel (0-6)"
44 int typestr="level"
45 default="3"
46 optional
47 details="
48         Log messages are always written to stderr while normal output
49         goes to stdout. Lower values mean more verbose logging.
50 "
51
52 option "paths" p
53 #~~~~~~~~~~~~~~~
54 "files to take into account"
55 string typestr="pattern"
56 optional
57 details="
58         Shell wildcard pattern that must match a file in order to be
59         included in the database in --create mode or in the output
60         for --select mode. Only the part of the filename below the
61         base directory is matched against the pattern. The default
62         is to take all files into account. See fnmatch(3) for details.
63 "
64
65 ###############
66 section "Modes"
67 ###############
68
69 defgroup "mode"
70 #==============
71 groupdesc="
72         adu may be started in one of two possible modes, each of which
73         corresponds to a different command line option. Exactly one
74         of these options must be given.
75
76 "
77 required
78
79 groupoption "create" C
80 #~~~~~~~~~~~~~~~~~~~~~
81 "Create a new database"
82 group="mode"
83 details="
84         Traverse the given directory and track disk user on a per-user
85         basis. Results are stored in N + 1 osl tables where N is
86         the number of uids that own at least one regular file in
87         that directory.
88 "
89
90 groupoption "interactive" I
91 #~~~~~~~~~~~~~~~~~~~~~
92 "activate interactive mode"
93 group="mode"
94 details="
95         In this mode, adu reads commands from stdin.
96 "
97
98 groupoption "select" S
99 #~~~~~~~~~~~~~~~~~~~~~
100 "query a database previously created with --create"
101 group="mode"
102 details="
103         This option prints statistics about matching subdirectories to
104         stdout. The output depends on the other options, see below.
105 "
106
107 ##############################
108 section "Options for --create"
109 ##############################
110
111 option "base-dir" b
112 #~~~~~~~~~~~~~~~~~~
113 "directory to traverse"
114 string typestr="path"
115 dependon="create"
116 optional
117 details="
118         The base directory to be traversed recursively. Must be
119         given if --create mode was selected. A warning message is
120         printed for each subdirectory that could not be read because
121         of insufficient permission. These directories will be ignored
122         when computing statistics.
123 "
124
125 option "one-file-system" x
126 #~~~~~~~~~~~~~~~~~~~~~~~~~
127 "do not dive into other file systems"
128 flag off
129 dependon="create"
130 details="
131         Skip directories that are on different filesystems from the
132         one that the argument being processed is on.
133 "
134
135 option "hash-table-bits" -
136 #~~~~~~~~~~~~~~~~~~~~~~~~~
137 "specify the size of the uid hash table"
138 int typestr="num"
139 dependon="create"
140 default="10"
141 optional
142 details="
143         Use a hash table of size 2^num for the uid entries. If more than
144         2^num different uids own at least one regular file under base-dir,
145         the command fails. Increase this value if you have more than 1024
146         users. Decreasing the value causes adu to use slightly less memory.
147 "
148
149 ##############################
150 section "Options for --select"
151 ##############################
152
153 option "select-options" s
154 #~~~~~~~~~~~~~~~~~~~~~~~~~
155 "options for select mode"
156 string typestr="<options>"
157 optional
158 dependon="select"
159 details="
160         Try --select-options \"-h\"
161 "
162
163 option "limit" L
164 #~~~~~~~~~~~~~~~
165 "Limit output"
166 int typestr="num"
167 default="-1"
168 optional
169 dependon="select"
170 details="
171         Only print num lines of output. If negative (the default),
172         print all lines.
173 "
174
175 option "size-unit" -
176 #~~~~~~~~~~~~~~~~~~~
177 "select output format for sizes"
178 enum typestr="format"
179 values="h","b","k","m","g","t"
180 default="h"
181 optional
182 dependon="select"
183 details="
184         Print sizes in the given unit: human-readable, bytes,
185         kilobytes (2^10), megabytes (2^20), gigabytes (2^30), terabytes
186         (2^40). The default is \"h\", i.e. human-readable.
187 "
188
189 option "count-unit" -
190 #~~~~~~~~~~~~~~~~~~~~
191 "select output format for counted values"
192 enum typestr="format"
193 values="h","n","k","m","g","t"
194 default="h"
195 optional
196 dependon="select"
197 details="
198         Print the number of files/directories in the given unit:
199         human-readable, number, number/10^3, number/10^6, number/10^12,
200         number/10^15. The default is to print numbers in human-readable
201         format.
202 "
203
204 option "print-base-dir" -
205 #~~~~~~~~~~~~~~~~~~~~~~~~
206 "whether to include the base-dir in the output"
207 flag off
208 details="
209         If this flag is given, all directories printed are prefixed
210         with the base directory. The default is to print paths relative
211         to the base dir.
212 "
213
214 option "no-headers" -
215 #~~~~~~~~~~~~~~~~~~~~
216 "supress descriptions for listings/tables"
217 flag off
218 dependon="select"
219 details="
220         This is mostly useful to feed the output of adu to scripts.
221 "
222
223 option "global-list" -
224 #~~~~~~~~~~~~~~~~~~~~~
225 "how to print global directory listings"
226 enum typestr="which"
227 values="size","file_count","both","none"
228 default="both"
229 optional
230 dependon="select"
231 details="
232         By default adu prints two global directory listings: The
233         first prints the directory names ordered by the sum of the
234         sizes of the contained files while the second listing prints
235         them sorted by the number of files. This option can be used
236         to print only one or neither of these two listings.
237 "
238
239 option "no-global-summary" -
240 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
241 "do not print the summary line"
242 flag off
243 dependon="select"
244
245 option "user-list" -
246 #~~~~~~~~~~~~~~~~~~~
247 "how to print per-user directory listings"
248 enum typestr="which"
249 values="size","file_count","both","none"
250 default="both"
251 optional
252 dependon="select"
253 details="
254         Similar to the global directory listings mentioned above,
255         adu can print two directory listings per user. This option
256         controls which of the these should be printed.
257 "
258
259 option "no-user-summary" -
260 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
261 "do not print the user summary table"
262 flag off
263 dependon="select"
264
265
266 option "user-summary-sort" -
267 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
268 "how to sort the user-summary"
269 enum typestr="col_spec"
270 values="name","uid","dir_count","file_count","size"
271 default="size"
272 optional
273 dependon="select"
274 details="
275         It is enough to specify the first letter of the column specifier,
276         e.g. \"--user-summary-sort f\" sorts by file count.
277 "