88459cdecc73f7b1f3f2682f13315486958db276
[dss.git] / dss.ggo
1 #
2 package "dss"
3 version "0.0.1"
4 purpose "the dyadic snapshot scheduler"
5
6 text "
7 dss snapshot aging is implemented in terms of intervals. There are
8 two command line options related to intervals: the duration of a
9 'unit' interval and the number of those intervals.
10
11 dss removes any snapshots older than the given number of intervals
12 times the duration of an unit interval and tries to keep the following
13 amount of snapshots per interval:
14
15         interval number         number of snapshots
16         ===============================================
17         0                       2 ^ (num_intervals - 1)
18         1                       2 ^ (num_intervals - 2)
19         2                       2 ^ (num_intervals - 3)
20         ...
21         num_intervals - 2                       2
22         num_intervals - 1                       1
23         num_intervals                           0
24
25 In other words, the oldest snapshot will at most be unit_interval *
26 num_intervala old (= 5 days * 4 = 20 days if default values are used).
27 Moreover, there are at most 2^num_intervals - 1 snapshots in total
28 (i.e. 31 by default).  Observe that you have to create at least
29 num_intervals snapshots each interval for this to work out.  "
30
31
32
33 option "config_file" c
34 #~~~~~~~~~~~~~~~~~~~~~
35 "(default='~/.dssrc')"
36
37         string typestr="filename"
38         optional
39
40 section "Logging"
41 #~~~~~~~~~~~~~~~~
42
43 option "loglevel" l
44 #~~~~~~~~~~~~~~~~~~
45
46 "set loglevel (0-6)"
47
48         int typestr="level"
49         default="4"
50         optional
51
52 defgroup "command"
53 groupdesc="
54         dss supports a couple of commands each of which corresponds to a different
55         command line option. Exactly one of these options must be given.
56 "
57 required
58
59 groupoption "create" C
60 #~~~~~~~~~~~~~~~~~~~~~
61 "create a new snapshot"
62 group="command"
63 details="
64         Execute the rsync command to create a new snapshot.Mote that this
65         command does not care about free disk space.
66 "
67 groupoption "prune" P
68 #~~~~~~~~~~~~~~~~~~~~
69 "remove a redundant snapshot"
70 group="command"
71 details="
72         A snapshot is considered redundant if it ether belongs to
73         an interval greater than the maximum nuber of intervals,
74         or if it belongs to an interval that already contains more
75         than the desired number of snapshots.
76 "
77
78 groupoption "ls" L
79 #~~~~~~~~~~~~~~~~~
80 "print a list of all snapshots"
81 group="command"
82 details="
83         The list will contain all snapshots not matter of their state,
84         i.e. incomplete snapshots and snapshots being deleted will
85         also be listed.
86 "
87
88 groupoption "run" R
89 #~~~~~~~~~~~~~~~~~~
90 "start creating and pruning snapshots"
91 group="command"
92 details="
93         This is the main mode of operation. Snapshots will be created
94         as needed and pruned automatically.
95 "
96
97 option "logfile" -
98 #~~~~~~~~~~~~~~~~~
99
100 "logfile for the dss daemon process"
101
102         string typestr="filename"
103         optional
104
105 section "rsync-related options"
106 #==============================
107
108 option "remote_user" U
109 #~~~~~~~~~~~~~~~~~~~~~
110
111 "remote user name (default: current user)"
112
113         string typestr="username"
114         optional
115
116 option "remote_host" H
117 #~~~~~~~~~~~~~~~~~~~~~
118
119 "remote host"
120
121         string typestr="hostname"
122         default="localhost"
123         optional
124
125 option "source_dir" S
126 #~~~~~~~~~~~~~~~~~~~~
127
128 "directory to backup on the remote host"
129
130         string typestr="dirname"
131         optional
132
133 option "dest_dir" D
134 #~~~~~~~~~~~~~~~~~~
135
136 "snapshots dir on the local host"
137
138         string typestr="dirname"
139         optional
140
141 option "rsync_option" O
142 #~~~~~~~~~~~~~~~~~~~~~~
143
144 "further rsync options that are passed
145 verbatim to the rsync command."
146
147         string typestr="option"
148         optional
149         multiple
150
151
152 option "exclude_patterns" e
153 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
155 "rsync exclude patterns"
156
157         string typestr="path"
158         optional
159
160
161 section "Intervals"
162 #~~~~~~~~~~~~~~~~~~
163
164
165 option "unit_interval" u
166 #~~~~~~~~~~~~~~~~~~~~~~~
167 "the duration of a unit interval"
168
169         int typestr="days"
170         default="4"
171         optional
172
173 option "num_intervals" n
174 #~~~~~~~~~~~~~~~~~~~~~~~
175 "the number of unit intervals"
176
177         int typestr="num"
178         default="5"
179         optional
180
181 section "Hooks"
182 #==============
183
184 option "pre_create_hook" r
185 #~~~~~~~~~~~~~~~~~~~~~~~~~~
186 "Executed before snapshot creation"
187
188         string typestr="command"
189         default="/bin/true"
190         optional
191
192 details="
193         Execute this command before trying to create a new snapshot
194         If this command returns with a non-zero exit status, do not
195         perform the backup. One possible application of this is to
196         return non-zero during office hours in order to not slow down
197         the file systems by taking snapshots.
198 "
199
200
201 option "post_create_hook" o
202 #~~~~~~~~~~~~~~~~~~~~~~~~~~
203 "Executed after snapshot creation"
204
205         string typestr="command"
206         default="/bin/true"
207         optional
208
209 details="
210         Execute this after a snapshot has successfully been created
211         The return value on the command is ignored. For instance one
212         could count the number of files per user and/or the disk
213         usage patterns in order to store them in a database for
214         further treatment.
215 "
216 option "creation_sleep" s
217 #~~~~~~~~~~~~~~~~~~~~~~~~
218 "sleep interval"
219
220         int typestr="minutes"
221         default="60"
222         optional
223
224 details="
225         The sleep interval for snapshot creation in minutes.
226         The daemon will, in an endlees loop, create a snapshot and
227         then sleep that many minutes.
228 "
229
230
231 option "min_free" m
232 #~~~~~~~~~~~~~~~~~~
233
234 "minimal amount of free space"
235
236         int typestr="gigabytes"
237         default="50"
238         optional
239
240 details="
241         If less that this many gigabytes of space is available,
242         dss will start to remove snapshots (starting from the oldest
243         snapshot) until the free disk space exeecds this value.
244 "