flush output after each command in interactive mode.
[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 "loglevel" l
30 #~~~~~~~~~~~~~~~~~~
31 "Set loglevel (0-6)"
32 int typestr="level"
33 default="4"
34 optional
35 details="
36         Log messages are always written to stderr while normal output
37         goes to stdout. Lower values mean more verbose logging.
38 "
39
40 defgroup "database"
41 #==================
42 groupdesc="
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.
48
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.
52 "
53
54 groupoption "database-dir" d
55 #~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 "directory containing the osl tables"
57 group="database"
58 string typestr="path"
59 details="
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.
63 "
64
65 groupoption "database-root" r
66 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67 "directory containing directories containing the osl tables"
68 group="database"
69 string typestr="path"
70 default="/var/lib/adu"
71 dependon="base-dir"
72 optional
73 details="
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.
78 "
79
80 ###############
81 section "Modes"
82 ###############
83
84 defgroup "mode"
85 #==============
86 groupdesc="
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.
90 "
91 required
92
93 groupoption "create" C
94 #~~~~~~~~~~~~~~~~~~~~~
95 "Create a new database"
96 group="mode"
97 details="
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
101         in that directory.
102 "
103
104 groupoption "interactive" I
105 #~~~~~~~~~~~~~~~~~~~~~~~~~~
106 "activate interactive mode"
107 group="mode"
108 details="
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).
112
113         In interactive mode, several subcommands are available, see
114         the end of this document.
115 "
116
117 groupoption "select" S
118 #~~~~~~~~~~~~~~~~~~~~~
119 "query a database previously created with --create"
120 group="mode"
121 details="
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.
126 "
127
128 ##############################
129 section "Options for --create"
130 ##############################
131
132 option "base-dir" b
133 #~~~~~~~~~~~~~~~~~~
134 "directory to traverse"
135 string typestr="path"
136 optional
137 details="
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.
142 "
143
144 option "one-file-system" x
145 #~~~~~~~~~~~~~~~~~~~~~~~~~
146 "do not dive into other file systems"
147 flag off
148 dependon="create"
149 details="
150         Skip directories that are on different file systems from the
151         one that the argument being processed is on.
152 "
153
154 option "hash-table-bits" -
155 #~~~~~~~~~~~~~~~~~~~~~~~~~
156 "specify the size of the uid hash table"
157 int typestr="num"
158 dependon="create"
159 default="10"
160 optional
161 details="
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.
166 "
167
168 ##############################
169 section "Options for --select"
170 ##############################
171
172 option "select-options" s
173 #~~~~~~~~~~~~~~~~~~~~~~~~~
174 "Options for select mode"
175 string typestr="<options>"
176 optional
177 dependon="select"
178 details="
179         This option takes a string whose content is another set of
180         options as described below. Select options may be specified
181         either directly in select mode, in which case you have use
182         quotes to prevent the select options from being interpreted
183         as adu options, or via the \"set\" command in interactive mode.
184 "