1 # Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
3 # Licensed under the GPL v2. For licencing details see COPYING.
7 purpose "the dyadic snapshot scheduler
9 dss creates hardlink-based snapshots of a given directory on a remote
10 or local host using rsync's link-dest feature.
13 #########################
14 section "General options"
15 #########################
17 option "config-file" c
18 #~~~~~~~~~~~~~~~~~~~~~
19 "(default='~/.dssrc')"
20 string typestr="filename"
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.
28 However, there is an important exception to this rule:
29 If the --run option was given (see below) then dss honors
30 SIGHUP and re-reads its configuration file whenever it
31 receives this signal. In this case the options in the config
32 file override any options that were previously given at the
33 command line. This allows to change the configuration of a
34 running dss process on the fly by sending SIGHUP.
39 "Run as background daemon"
43 Note that dss refuses to start in daemon mode if no logfile
44 was specified. This option is mostly useful in conjuction
45 with the -R option described below.
47 Note that it is not possible to change whether dss runs as
48 background daemon by sending SIGHUP.
53 "Only print what would be done"
56 This flag does not make sense for all commands. The run
57 command refuses to start if this option was given. The ls
58 command silently ignores this flag.
72 Lower values mean more verbose logging.
77 "Logfile for the dss daemon process"
78 string typestr="filename"
81 This option is mostly useful for the run command if --daemon
92 dss supports a couple of commands each of which corresponds
93 to a different command line option. Exactly one of these
94 options must be given.
99 groupoption "create" C
100 #~~~~~~~~~~~~~~~~~~~~~
101 "Create a new snapshot"
104 Execute the rsync command to create a new snapshot. Note that
105 this command does not care about free disk space.
108 groupoption "prune" P
109 #~~~~~~~~~~~~~~~~~~~~
110 "Remove a redundant snapshot"
113 A snapshot is considered redundant if it ether belongs to
114 an interval greater than the maximum number of intervals,
115 or if it belongs to an interval that already contains more
116 than the desired number of snapshots.
121 "Print a list of all snapshots"
124 The list will contain all snapshots no matter of their state,
125 i. e. incomplete snapshots and snapshots being deleted will
131 "Start creating and pruning snapshots"
134 This is the main mode of operation. Snapshots will be created
135 as needed and pruned automatically.
138 ###############################
139 section "Rsync-related options"
140 ###############################
142 option "remote-host" H
143 #~~~~~~~~~~~~~~~~~~~~~
145 string typestr="hostname"
149 If this option is given and its value differs from the local
150 host, then rsync uses ssh. Make sure there is no password
151 needed for the ssh connection. To achieve that, use public key
152 authentication for ssh and, if needed, set the remote user name
153 by using the --remote-user option.
156 option "remote-user" U
157 #~~~~~~~~~~~~~~~~~~~~~
158 "Remote user name (default: current user)"
159 string typestr="username"
162 Set this if the user running dss is different from the
163 user at the remote host when using ssh.
166 option "source-dir" -
167 #~~~~~~~~~~~~~~~~~~~~
169 string typestr="dirname"
172 The directory on the remote host from which snapshots are
173 taken. Of course, the user specified as --remote-user must
174 have read access to this directory.
180 string typestr="dirname"
183 The destination directory on the local host where snapshots
184 will be written. This must be writable by the user who runs
188 option "rsync-option" O
189 #~~~~~~~~~~~~~~~~~~~~~~
190 "Further rsync options"
191 string typestr="option"
195 These option may be given multiple times. The arguments passed
196 to that option are passed verbatim to the rsync command.
203 option "unit-interval" u
204 #~~~~~~~~~~~~~~~~~~~~~~~
205 "The duration of a unit interval"
210 dss snapshot aging is implemented in terms of intervals. There
211 are two command line options related to intervals: the
212 duration u of a \"unit\" interval and the number n of those
215 dss removes any snapshots older than n times u and tries to
216 keep 2^(k-1) snapshots in interval k, where the interval number
217 k counts from zero, zero being the most recent unit interval.
219 In other words, the oldest snapshot will at most be u * n days
220 (= 20 days if default values are used) old. Moreover, there
221 are at most 2^n - 1 snapshots in total (i. e. 31 by default).
222 Observe that you have to create at least 2 ^ (n - 1) snapshots
223 each interval for this to work out because that is the number
224 of snapshots in interval zero.
227 option "num-intervals" n
228 #~~~~~~~~~~~~~~~~~~~~~~~
229 "The number of unit intervals"
238 option "pre-create-hook" r
239 #~~~~~~~~~~~~~~~~~~~~~~~~~~
240 "Executed before snapshot creation"
241 string typestr="command"
244 Execute this command before trying to create a new snapshot.
245 If this command returns with a non-zero exit status, no
246 snapshot is being created and the operation is retried later.
248 For example, one might want to execute a script that checks
249 whether all snapshot-related file systems are properly mounted.
251 Another possible application of this is to return non-zero
252 during office hours in order to not slow down the file systems
256 option "post-create-hook" o
257 #~~~~~~~~~~~~~~~~~~~~~~~~~~
258 "Executed after snapshot creation"
259 string typestr="command"
262 Execute this after a snapshot has successfully been
263 created. The full path of the newly created snapshot is
264 passed to the hook as the first argument. The exit code of
265 this hook is ignored.
267 For instance this hook can be used to count the number of
268 files per user and/or the disk usage patterns in order to
269 store them in a database for further analysis.
272 ###############################
273 section "Disk space monitoring"
274 ###############################
276 option "min-free-mb" m
277 #~~~~~~~~~~~~~~~~~~~~~
278 "Minimal amount of free disk space"
279 int typestr="megabytes"
283 If disk space on the file system containing the destination
284 directory gets low, \"dss --run\" will suspend the currently
285 running rsync process and will start to remove snapshots in
286 order to free disk space. This option specifies the minimal
287 amount of free disk space. If less than the given number of
288 megabytes is available, snapshots are being deleted. See also
289 the --min_free_percent and the min-free-percent-inodes options.
291 A value of zero deactivates this check.
294 option "min-free-percent" p
295 #~~~~~~~~~~~~~~~~~~~~~~~~~~
296 "Minimal percent of free disk space"
297 int typestr="percent"
301 See --min-free-mb. Note that it is not recommended to set both
302 --min-free-mb and --min-free-percent to zero as this will
303 cause your file system to fill up quickly.
305 option "min-free-percent-inodes" i
306 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307 "Minimal percent of free inodes"
308 int typestr="percent"
312 Specify the minimum amount of free inodes on the file system
313 containing the destination dir. If less than that many inodes
314 are free, snapshot removal kicks in just as in case of low
317 Note that not every file system supports the concept of inodes.
318 Moreover it is not possible to reliably detect whether this is
319 the case. Therefore this feature is disabled by default. It's
320 safe to enable it for ext3 file systems on linux though.
322 A value of zero (the default) deactivates this check.