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
88 dss supports a couple of commands each of which corresponds
89 to a different command line option. Exactly one of these
90 options must be given.
94 groupoption "create" C
95 #~~~~~~~~~~~~~~~~~~~~~
96 "Create a new snapshot"
99 Execute the rsync command to create a new snapshot. Note that
100 this command does not care about free disk space.
103 groupoption "prune" P
104 #~~~~~~~~~~~~~~~~~~~~
105 "Remove a redundant snapshot"
108 A snapshot is considered redundant if it ether belongs to
109 an interval greater than the maximum number of intervals,
110 or if it belongs to an interval that already contains more
111 than the desired number of snapshots.
116 "Print a list of all snapshots"
119 The list will contain all snapshots no matter of their state,
120 i. e. incomplete snapshots and snapshots being deleted will
126 "Start creating and pruning snapshots"
129 This is the main mode of operation. Snapshots will be created
130 as needed and pruned automatically.
133 ###############################
134 section "Rsync-related options"
135 ###############################
137 option "remote-host" H
138 #~~~~~~~~~~~~~~~~~~~~~
140 string typestr="hostname"
144 If this option is given and its value differs from the local
145 host, then rsync uses ssh. Make sure there is no password
146 needed for the ssh connection. To achieve that, use public key
147 authentication for ssh and, if needed, set the remote user name
148 by using the --remote-user option.
151 option "remote-user" U
152 #~~~~~~~~~~~~~~~~~~~~~
153 "Remote user name (default: current user)"
154 string typestr="username"
157 Set this if the user running dss is different from the
158 user at the remote host when using ssh.
161 option "source-dir" -
162 #~~~~~~~~~~~~~~~~~~~~
164 string typestr="dirname"
167 The directory on the remote host from which snapshots are
168 taken. Of course, the user specified as --remote-user must
169 have read access to this directory.
175 string typestr="dirname"
178 The destination directory on the local host where snapshots
179 will be written. This must be writable by the user who runs
183 option "rsync-option" O
184 #~~~~~~~~~~~~~~~~~~~~~~
185 "Further rsync options"
186 string typestr="option"
190 These option may be given multiple times. The arguments passed
191 to that option are passed verbatim to the rsync command.
198 option "unit-interval" u
199 #~~~~~~~~~~~~~~~~~~~~~~~
200 "The duration of a unit interval"
205 dss snapshot aging is implemented in terms of intervals. There
206 are two command line options related to intervals: the
207 duration u of a \"unit\" interval and the number n of those
210 dss removes any snapshots older than n times u and tries to
211 keep 2^(k-1) snapshots in interval k, where the interval number
212 k counts from zero, zero being the most recent unit interval.
214 In other words, the oldest snapshot will at most be u * n days
215 (= 20 days if default values are used) old. Moreover, there
216 are at most 2^n - 1 snapshots in total (i. e. 31 by default).
217 Observe that you have to create at least 2 ^ (n - 1) snapshots
218 each interval for this to work out because that is the number
219 of snapshots in interval zero.
222 option "num-intervals" n
223 #~~~~~~~~~~~~~~~~~~~~~~~
224 "The number of unit intervals"
233 option "pre-create-hook" r
234 #~~~~~~~~~~~~~~~~~~~~~~~~~~
235 "Executed before snapshot creation"
236 string typestr="command"
239 Execute this command before trying to create a new snapshot.
240 If this command returns with a non-zero exit status, no
241 snapshot is being created and the operation is retried later.
243 For example, one might want to execute a script that checks
244 whether all snapshot-related file systems are properly mounted.
246 Another possible application of this is to return non-zero
247 during office hours in order to not slow down the file systems
251 option "post-create-hook" o
252 #~~~~~~~~~~~~~~~~~~~~~~~~~~
253 "Executed after snapshot creation"
254 string typestr="command"
257 Execute this after a snapshot has successfully been
258 created. The full path of the newly created snapshot is
259 passed to the hook as the first argument. The exit code of
260 this hook is ignored.
262 For instance this hook can be used to count the number of
263 files per user and/or the disk usage patterns in order to
264 store them in a database for further analysis.
267 ###############################
268 section "Disk space monitoring"
269 ###############################
271 option "min-free-mb" m
272 #~~~~~~~~~~~~~~~~~~~~~
273 "Minimal amount of free disk space"
274 int typestr="megabytes"
278 If disk space on the file system containing the destination
279 directory gets low, \"dss --run\" will suspend the currently
280 running rsync process and will start to remove snapshots in
281 order to free disk space. This option specifies the minimal
282 amount of free disk space. If less than the given number of
283 megabytes is available, snapshots are being deleted. See also
284 the --min_free_percent and the min-free-percent-inodes options.
286 A value of zero deactivates this check.
289 option "min-free-percent" p
290 #~~~~~~~~~~~~~~~~~~~~~~~~~~
291 "Minimal percent of free disk space"
292 int typestr="percent"
296 See --min-free-mb. Note that it is not recommended to set both
297 --min-free-mb and --min-free-percent to zero as this will
298 cause your file system to fill up quickly.
300 option "min-free-percent-inodes" i
301 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302 "Minimal percent of free inodes"
303 int typestr="percent"
307 Specify the minimum amount of free inodes on the file system
308 containing the destination dir. If less than that many inodes
309 are free, snapshot removal kicks in just as in case of low
312 Note that not every file system supports the concept of inodes.
313 Moreover it is not possible to reliably detect whether this is
314 the case. Therefore this feature is disabled by default. It's
315 safe to enable it for ext3 file systems on linux though.
317 A value of zero (the default) deactivates this check.