4 purpose "the dyadic snapshot scheduler
6 dss creates hardlink-based snapshots of a given directory on a remote
7 or local host using rsync's link-dest feature.
10 #########################
11 section "General options"
12 #########################
14 option "config-file" c
15 #~~~~~~~~~~~~~~~~~~~~~
16 "(default='~/.dssrc')"
17 string typestr="filename"
20 Options may be given at the command line or in the
21 configuration file. As usual, if an option is given both at
22 the command line and in the configuration file, the command
23 line option takes precedence.
25 However, there is an important exception to this rule:
26 If the --run option was given (see below) then dss honors
27 SIGHUP and re-reads its configuration file whenever it
28 receives this signal. In this case the options in the config
29 file override any options that were previously given at the
30 command line. This allows to change the configuration of a
31 running dss process on the fly by sending SIGHUP.
36 "Run as background daemon"
40 Note that dss refuses to start in daemon mode if no logfile
41 was specified. This option is mostly useful in conjuction
42 with the -R option described below.
44 Note that it is not possible to change whether dss runs as
45 background daemon by sending SIGHUP.
50 "Only print what would be done"
53 This flag does not make sense for all commands. The run
54 command refuses to start if this option was given. The ls
55 command silently ignores this flag.
69 Lower values mean more verbose logging.
74 "Logfile for the dss daemon process"
75 string typestr="filename"
78 This option is mostly useful for the run command if --daemon
85 dss supports a couple of commands each of which corresponds
86 to a different command line option. Exactly one of these
87 options must be given.
91 groupoption "create" C
92 #~~~~~~~~~~~~~~~~~~~~~
93 "Create a new snapshot"
96 Execute the rsync command to create a new snapshot. Note that
97 this command does not care about free disk space.
100 groupoption "prune" P
101 #~~~~~~~~~~~~~~~~~~~~
102 "Remove a redundant snapshot"
105 A snapshot is considered redundant if it ether belongs to
106 an interval greater than the maximum number of intervals,
107 or if it belongs to an interval that already contains more
108 than the desired number of snapshots.
113 "Print a list of all snapshots"
116 The list will contain all snapshots no matter of their state,
117 i. e. incomplete snapshots and snapshots being deleted will
123 "Start creating and pruning snapshots"
126 This is the main mode of operation. Snapshots will be created
127 as needed and pruned automatically.
130 ###############################
131 section "Rsync-related options"
132 ###############################
134 option "remote-host" H
135 #~~~~~~~~~~~~~~~~~~~~~
137 string typestr="hostname"
141 If this option is given and its value differs from the local
142 host, then rsync uses ssh. Make sure there is no password
143 needed for the ssh connection. To achieve that, use public key
144 authentication for ssh and, if needed, set the remote user name
145 by using the --remote-user option.
148 option "remote-user" U
149 #~~~~~~~~~~~~~~~~~~~~~
150 "Remote user name (default: current user)"
151 string typestr="username"
154 Set this if the user running dss is different from the
155 user at the remote host when using ssh.
158 option "source-dir" -
159 #~~~~~~~~~~~~~~~~~~~~
161 string typestr="dirname"
164 The directory on the remote host from which snapshots are
165 taken. Of course, the user specified as --remote-user must
166 have read access to this directory.
172 string typestr="dirname"
175 The destination directory on the local host where snapshots
176 will be written. This must be writable by the user who runs
180 option "rsync-option" O
181 #~~~~~~~~~~~~~~~~~~~~~~
182 "Further rsync options"
183 string typestr="option"
187 These option may be given multiple times. The arguments passed
188 to that option are passed verbatim to the rsync command.
191 option "exclude-patterns" e
192 #~~~~~~~~~~~~~~~~~~~~~~~~~~
193 "Rsync exclude patterns"
194 string typestr="path"
201 option "unit-interval" u
202 #~~~~~~~~~~~~~~~~~~~~~~~
203 "The duration of a unit interval"
208 dss snapshot aging is implemented in terms of intervals. There
209 are two command line options related to intervals: the
210 duration u of a \"unit\" interval and the number n of those
213 dss removes any snapshots older than n times u and tries to
214 keep 2^(k-1) snapshots in interval k, where the interval number
215 k counts from zero, zero being the most recent unit interval.
217 In other words, the oldest snapshot will at most be u * n days
218 (= 20 days if default values are used) old. Moreover, there
219 are at most 2^n - 1 snapshots in total (i. e. 31 by default).
220 Observe that you have to create at least 2 ^ (n - 1) snapshots
221 each interval for this to work out because that is the number
222 of snapshots in interval zero.
225 option "num-intervals" n
226 #~~~~~~~~~~~~~~~~~~~~~~~
227 "The number of unit intervals"
236 option "pre-create-hook" r
237 #~~~~~~~~~~~~~~~~~~~~~~~~~~
238 "Executed before snapshot creation"
239 string typestr="command"
242 Execute this command before trying to create a new snapshot.
243 If this command returns with a non-zero exit status, no
244 snapshot is being created and the operation is retried later.
246 For example, one might want to execute a script that checks
247 whether all snapshot-related file systems are properly mounted.
249 Another possible application of this is to return non-zero
250 during office hours in order to not slow down the file systems
254 option "post-create-hook" o
255 #~~~~~~~~~~~~~~~~~~~~~~~~~~
256 "Executed after snapshot creation"
257 string typestr="command"
260 Execute this after a snapshot has successfully been
261 created. The full path of the newly created snapshot is passed
262 to the hook as the first argument. The return value of that
265 For instance this hook can be used to count the number of
266 files per user and/or the disk usage patterns in order to
267 store them in a database for further treatment.
270 ###############################
271 section "Disk space monitoring"
272 ###############################
274 option "min-free-mb" m
275 #~~~~~~~~~~~~~~~~~~~~~
276 "Minimal amount of free disk space"
277 int typestr="megabytes"
281 If disk space on the file system containing the destination
282 directory gets low, \"dss --run\" will suspend the currently
283 running rsync process and will start to remove snapshots in
284 order to free disk space. This option specifies the minimal
285 amount of free disk space. If less than the given number of
286 megabytes is available, snapshots are being deleted. See also
287 the --min_free_percent and the min-free-percent-inodes options.
289 A value of zero deactivates this check.
292 option "min-free-percent" p
293 #~~~~~~~~~~~~~~~~~~~~~~~~~~
294 "Minimal percent of free disk space"
295 int typestr="percent"
299 See --min-free-mb. Note that it is not recommended to set both
300 --min-free-mb and --min-free-percent to zero as this will
301 cause your file system to fill up quickly.
303 option "min-free-percent-inodes" i
304 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
305 "Minimal percent of free inodes"
306 int typestr="percent"
310 Specify the minimum amount of free inodes on the file system
311 containing the destination dir. If less than that many inodes
312 are free, snatshot removal kicks in just as in case of low
315 A value of zero deactivates this check.