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.
33 Note that it is not possible to change whether dss runs as
34 background daemon 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.
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 less 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 to a different
86 command line option. Exactly one of these options must be given.
90 groupoption "create" C
91 #~~~~~~~~~~~~~~~~~~~~~
92 "Create a new snapshot"
95 Execute the rsync command to create a new snapshot. Note that this
96 command does not care about free disk space.
100 "Remove a redundant snapshot"
103 A snapshot is considered redundant if it ether belongs to
104 an interval greater than the maximum number of intervals,
105 or if it belongs to an interval that already contains more
106 than the desired number of snapshots.
111 "Print a list of all snapshots"
114 The list will contain all snapshots no matter of their state,
115 i. e. incomplete snapshots and snapshots being deleted will
121 "Start creating and pruning snapshots"
124 This is the main mode of operation. Snapshots will be created
125 as needed and pruned automatically.
128 ###############################
129 section "Rsync-related options"
130 ###############################
132 option "remote-host" H
133 #~~~~~~~~~~~~~~~~~~~~~
135 string typestr="hostname"
139 If this option is given and its value differs from the local
140 host, then rsync uses ssh. Make sure there is no password
141 needed for the ssh connection. To achieve that, use public key
142 authentication for ssh and, if needed, set the remote user name
143 by using the --remote-user option.
146 option "remote-user" U
147 #~~~~~~~~~~~~~~~~~~~~~
148 "Remote user name (default: current user)"
149 string typestr="username"
152 Set this if the user running dss is different from the
153 user at the remote host when using ssh.
156 option "source-dir" -
157 #~~~~~~~~~~~~~~~~~~~~
159 string typestr="dirname"
162 The directory on the remote host from which snapshots are
163 taken. Of course, the user specified as --remote-user must
164 have read access to this directory.
170 string typestr="dirname"
173 The destination directory on the local host where snapshots
174 will be written. This must be writable by the user who runs
178 option "rsync-option" O
179 #~~~~~~~~~~~~~~~~~~~~~~
180 "Further rsync options"
181 string typestr="option"
185 These option may be given multiple times. The arguments passed
186 to that option are passed verbatim to the rsync command.
189 option "exclude-patterns" e
190 #~~~~~~~~~~~~~~~~~~~~~~~~~~
191 "Rsync exclude patterns"
192 string typestr="path"
199 option "unit-interval" u
200 #~~~~~~~~~~~~~~~~~~~~~~~
201 "The duration of a unit interval"
206 dss snapshot aging is implemented in terms of intervals. There are
207 two command line options related to intervals: the duration of a
208 \"unit\" interval and the number of those unit intervals.
210 dss removes any snapshots older than the given number of intervals
211 times the duration of a unit interval and tries to keep the following
212 number of snapshots per interval:
214 interval number number of snapshots
215 ===============================================
216 0 2 ^ (num-intervals - 1)
217 1 2 ^ (num-intervals - 2)
218 2 2 ^ (num-intervals - 3)
224 In other words, the oldest snapshot will at most be unit_interval *
225 num_intervals old (= 5 days * 4 = 20 days if default values are used).
226 Moreover, there are at most 2^num_intervals - 1 snapshots in total
227 (i. e. 31 by default). Observe that you have to create at least
228 2 ^ (num_intervals - 1) snapshots each interval for this to work out.
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"
249 Execute this command before trying to create a new snapshot.
250 If this command returns with a non-zero exit status, do not
251 perform the backup. One possible application of this is to
252 return non-zero during office hours in order to not slow down
253 the file systems by taking snapshots.
257 option "post-create-hook" o
258 #~~~~~~~~~~~~~~~~~~~~~~~~~~
259 "Executed after snapshot creation"
260 string typestr="command"
264 Execute this after a snapshot has successfully been created
265 The return value on the command is ignored. For instance one
266 could count the number of files per user and/or the disk
267 usage patterns in order to store them in a database for
271 ###############################
272 section "Disk space monitoring"
273 ###############################
275 option "min-free-mb" m
276 #~~~~~~~~~~~~~~~~~~~~~
277 "Minimal amount of free disk space"
278 int typestr="megabytes"
282 If less than this many megabytes of space is available on
283 the file system containing the destination directory, \"dss
284 --run\" will suspend the currently running rsync process and will
285 start to remove snapshots, starting from the oldest snapshot,
286 until the free disk space exceeds this value. See also the
287 --min_free_percent option.
289 A value of zero deactivates this check.
293 option "min-free-percent" p
294 #~~~~~~~~~~~~~~~~~~~~~~~~~~
295 "Minimal percent of free disk space"
296 int typestr="percent"
300 See --min-free-mb. Note that it is not recommended to set both
301 --min-free-mb and --min-free-percent to zero as this will
302 cause your file system to fill up quickly.