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 redundant and outdated snapshots"
113 A snapshot is considered outdated if it belongs to an interval
114 greater than the maximum number of intervals. It is said to be
115 redundant if it belongs to an interval that already contains
116 more than the desired number of snapshots. This command gets
117 rid of such snapshots.
122 "Print a list of all snapshots"
125 The list will contain all snapshots no matter of their state,
126 i. e. incomplete snapshots and snapshots being deleted will
132 "Start creating and pruning snapshots"
135 This is the main mode of operation. Snapshots will be created
136 in an endless loop as needed and pruned automatically. The loop
137 only terminates on fatal errors or if a terminating signal was
138 received. See also the --exit-hook option.
141 ###############################
142 section "Rsync-related options"
143 ###############################
145 option "remote-host" H
146 #~~~~~~~~~~~~~~~~~~~~~
148 string typestr="hostname"
152 If this option is given and its value differs from the local
153 host, then rsync uses ssh. Make sure there is no password
154 needed for the ssh connection. To achieve that, use public key
155 authentication for ssh and, if needed, set the remote user name
156 by using the --remote-user option.
159 option "remote-user" U
160 #~~~~~~~~~~~~~~~~~~~~~
161 "Remote user name (default: current user)"
162 string typestr="username"
165 Set this if the user running dss is different from the
166 user at the remote host when using ssh.
169 option "source-dir" -
170 #~~~~~~~~~~~~~~~~~~~~
172 string typestr="dirname"
175 The directory on the remote host from which snapshots are
176 taken. Of course, the user specified as --remote-user must
177 have read access to this directory.
183 string typestr="dirname"
186 The destination directory on the local host where snapshots
187 will be written. This must be writable by the user who runs
191 option "rsync-option" O
192 #~~~~~~~~~~~~~~~~~~~~~~
193 "Further rsync options"
194 string typestr="option"
198 These option may be given multiple times. The arguments passed
199 to that option are passed verbatim to the rsync command.
206 option "unit-interval" u
207 #~~~~~~~~~~~~~~~~~~~~~~~
208 "The duration of a unit interval"
213 dss snapshot aging is implemented in terms of intervals. There
214 are two command line options related to intervals: the
215 duration u of a \"unit\" interval and the number n of those
218 dss removes any snapshots older than n times u and tries to
219 keep 2^(n - k - 1) snapshots in interval k, where the interval
220 number k counts from zero, zero being the most recent unit
223 In other words, the oldest snapshot will at most be u * n days
224 (= 20 days if default values are used) old. Moreover, there
225 are at most 2^n - 1 snapshots in total (i. e. 31 by default).
226 Observe that you have to create at least 2^(n - 1) snapshots
227 each interval for this to work out because that is the number
228 of snapshots in interval zero.
231 option "num-intervals" n
232 #~~~~~~~~~~~~~~~~~~~~~~~
233 "The number of unit intervals"
242 option "pre-create-hook" r
243 #~~~~~~~~~~~~~~~~~~~~~~~~~~
244 "Executed before snapshot creation"
245 string typestr="command"
248 Execute this command before trying to create a new snapshot.
249 If this command returns with a non-zero exit status, no
250 snapshot is being created and the operation is retried later.
252 For example, one might want to execute a script that checks
253 whether all snapshot-related file systems are properly mounted.
255 Another possible application of this is to return non-zero
256 during office hours in order to not slow down the file systems
260 option "post-create-hook" o
261 #~~~~~~~~~~~~~~~~~~~~~~~~~~
262 "Executed after snapshot creation"
263 string typestr="command"
266 Execute this after a snapshot has successfully been
267 created. The full path of the newly created snapshot is
268 passed to the hook as the first argument. The exit code of
269 this hook is ignored.
271 For instance this hook can be used to count the number of
272 files per user and/or the disk usage patterns in order to
273 store them in a database for further analysis.
278 "Executed if run command exits"
279 string typestr="command"
282 This hook is only used if the --run command was given which
283 instructs dss to run in an endless loop. The exit-hook gets
284 executed whenever this endless loop terminates. The reason
285 for terminating the loop is passed as the first argument.
287 One possible application for this hook is to send email to the
288 system administrator to let her know that no more snapshots
289 are going to be created.
292 ###############################
293 section "Disk space monitoring"
294 ###############################
296 option "min-free-mb" m
297 #~~~~~~~~~~~~~~~~~~~~~
298 "Minimal amount of free disk space"
299 int typestr="megabytes"
303 If disk space on the file system containing the destination
304 directory gets low, \"dss --run\" will suspend the currently
305 running rsync process and will start to remove snapshots in
306 order to free disk space. This option specifies the minimal
307 amount of free disk space. If less than the given number of
308 megabytes is available, snapshots are being deleted. See also
309 the --min_free_percent and the min-free-percent-inodes options.
311 A value of zero deactivates this check.
314 option "min-free-percent" p
315 #~~~~~~~~~~~~~~~~~~~~~~~~~~
316 "Minimal percent of free disk space"
317 int typestr="percent"
321 See --min-free-mb. Note that it is not recommended to set both
322 --min-free-mb and --min-free-percent to zero as this will
323 cause your file system to fill up quickly.
325 option "min-free-percent-inodes" i
326 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327 "Minimal percent of free inodes"
328 int typestr="percent"
332 Specify the minimum amount of free inodes on the file system
333 containing the destination dir. If less than that many inodes
334 are free, snapshot removal kicks in just as in case of low
337 Note that not every file system supports the concept of inodes.
338 Moreover it is not possible to reliably detect whether this is
339 the case. Therefore this feature is disabled by default. It's
340 safe to enable it for ext3 file systems on linux though.
342 A value of zero (the default) deactivates this check.
345 option "keep-redundant" k
346 #~~~~~~~~~~~~~~~~~~~~~~~~
347 "Prune by disk space only"
350 If this flag is not given dss removes redundant and outdated
351 snapshots automatically.
353 Otherwise, this feature is deactivated so that snapshots are
354 only being removed in case disk space or number of free inodes
355 becomes low. Use this flag if the file system containing the
356 destination directory is used for snapshots only.