1 # Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
3 # Licensed under the GPL v2. For licencing details see COPYING.
7 purpose "advanced disk usage
9 adu creates a database containing disk usage statistics of a given
10 directory. It allows to query that database to quickly retrieve
11 usage patterns of subdirectories and/or files owned by a given user id.
14 #########################
15 section "General options"
16 #########################
18 option "config-file" c
19 #~~~~~~~~~~~~~~~~~~~~~
20 "(default='~/.adurc')"
21 string typestr="filename"
24 Options may be given at the command line or in the
25 configuration file. As usual, if an option is given both at
26 the command line and in the configuration file, the command
27 line option takes precedence.
31 option "database-dir" d
32 #~~~~~~~~~~~~~~~~~~~~~~
33 "directory containing the osl tables"
37 Full path to the directory containing the osl tables. This
38 directory must exist. It must be writable for the user running
39 adu in --create mode and readable in --select mode.
49 Log messages are always written to stderr while normal output
50 goes to stdout. Lower values mean more verbose logging.
55 "user id(s) to take into account"
56 string typestr="uid_spec"
60 An uid specifier may be a single number, or a range of uids.
63 --uid 42 # only consider uid 42
64 --uid 42- # only consider uids greater or equal than 42
65 --uid 23-42 # only consider uids between 23 and 42, inclusively.
67 This option may be given multiple times. An uid is taken into
68 account if it satisfies at least one --uid option.
74 "files to take into account"
75 string typestr="pattern"
78 Shell wildcard pattern that must match a file in order to be
79 included in the database in --create mode or in the output
80 for --select mode. Only the part of the filename below the
81 base directory is matched against the pattern. The default
82 is to take all files into account. See fnmatch(3) for details.
92 adu may be started in one of two possible modes, each of which
93 corresponds to a different command line option. Exactly one
94 of these options must be given.
99 groupoption "create" C
100 #~~~~~~~~~~~~~~~~~~~~~
101 "Create a new database"
104 Traverse the given directory and track disk user on a per-user
105 basis. Results are stored in N + 1 osl tables where N is
106 the number of uids that own at least one regular file in
110 groupoption "select" S
111 #~~~~~~~~~~~~~~~~~~~~~
112 "query a database previously created with --create"
115 This option prints statistics about matching subdirectories to
116 stdout. The output depends on the other options, see below.
119 ##############################
120 section "Options for --create"
121 ##############################
125 "directory to traverse"
126 string typestr="path"
130 The base directory to be traversed recursively. Must be
131 given if --create mode was selected. A warning message is
132 printed for each subdirectory that could not be read because
133 of insufficient permission. These directories will be ignored
134 when computing statistics.
137 option "one-file-system" x
138 #~~~~~~~~~~~~~~~~~~~~~~~~~
139 "do not dive into other file systems"
143 Skip directories that are on different filesystems from the
144 one that the argument being processed is on.
147 option "hash-table-bits" -
148 #~~~~~~~~~~~~~~~~~~~~~~~~~
149 "specify the size of the uid hash table"
155 Use a hash table of size 2^num for the uid entries. If more than
156 2^num different uids own at least one regular file under base-dir,
157 the command fails. Increase this value if you have more than 1024
158 users. Decreasing the value causes adu to use slightly less memory.
162 ##############################
163 section "Options for --select"
164 ##############################
174 Only print num lines of output. If negative (the default),
180 "select output format for sizes"
181 enum typestr="format"
182 values="h","b","k","m","g","t"
186 Print sizes in the given unit: human-readable, bytes,
187 kilobytes (2^10), megabytes (2^20), gigabytes (2^30), terabytes
188 (2^40). The default is \"h\", i.e. human-readable.
191 option "count_unit" -
192 #~~~~~~~~~~~~~~~~~~~~
193 "select output format for counted values"
194 enum typestr="format"
195 values="h","n","k","m","g","t"
199 Print the number of files/directories in the given unit:
200 human-readable, number, number/10^3, number/10^6, number/10^12,
201 number/10^15. The default is to print numbers in human-readable