2 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
7 The contents of this file are subject to the terms of the
8 Common Development and Distribution License, Version 1.0 only
9 (the "License"). You may not use this file except in compliance
12 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 or http://www.opensolaris.org/os/licensing.
14 See the License for the specific language governing permissions
15 and limitations under the License.
17 When distributing Covered Code, include this CDDL HEADER in each
18 file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 If applicable, add the following below this CDDL HEADER, with the
20 fields enclosed by brackets "[]" replaced with your own identifying
21 information: Portions Copyright [yyyy] [name of copyright owner]
25 Copyright 2009 Sun Microsystems, Inc. All rights reserved.
26 Use is subject to license terms.
30 <service_bundle type='manifest' name='SUNWgnome-time-slider'>
33 name='application/time-slider/plugin'
37 <!-- we need time-slider -->
40 grouping='require_all'
43 <service_fmri value='svc:/application/time-slider' />
47 These are bare bones, basic plugin methods. More
48 complex plugin instances should define their own
49 specifically tailored start/stop/refresh methods.
54 exec='/lib/svc/method/time-slider-plugin start'
65 <property_group name='startd' type='framework'>
66 <propval name='duration' type='astring' value='transient' />
69 <property_group name='general' type='framework'>
70 <propval name='action_authorization' type='astring'
71 value='solaris.smf.manage.zfs-auto-snapshot' />
72 <propval name='value_authorization' type='astring'
73 value='solaris.smf.manage.zfs-auto-snapshot' />
77 <!-- The properties we expect that any plugin instance will define:
79 trigger_command: A fully expanded command path plus all required arguments for
80 invocation of the plugin's trigger command. The purpose of
81 trigger_command is for notification when time-sliderd has created a
82 set of scheduled snapshots. The plugin can opt to take action immediately
83 or defer further actions until some later stage.
85 verbose: Send extra, verbose output to standard error and syslog for
86 analytical and debugging purposes if set to "true"
87 trigger_on: A comma seperated list of auto-snapshot SMF service instances
88 upon which to execute the command specified by plugin/command.
89 The keyword "all" serves as a wildcard value matching all
90 enabled auto-snapshot SMF instances, or as an example, a value
91 of "hourly,daily" would trigger the plugin for snapshot events
92 corresponding to the following SMF service instances:
93 svc://system/filesystem/zfs/auto-snapshot:hourly
94 svc://system/filesystem/zfs/auto-snapsoht:daily
97 <property_group name="plugin" type="application">
98 <propval name="trigger_command" type="astring"
99 value="Not Set" override="true"/>
100 <propval name="verbose" type="boolean"
101 value="false" override="true"/>
102 <propval name="trigger_on" type="astring"
103 value="hourly,daily,weekly,monthly" override="true"/>
107 <!-- We now define a plugin instance: "zfs-send"
108 to perform "zfs(1) send" based backups-->
110 <!-- This instance sends full or if possible, incremental
111 snapshot streams of the newly created snapshots.
112 Incremental streams are determined by the existance of the
114 "org.opensolaris:time-slider-plugin:zfs-send".
116 The value of this property represents the snapshot label
117 after the "@" of the previously sent snapshot and is set on
118 each filesystem or volume that was previously backed up using
119 the zfs-send plugin instance.
120 To force a full send of the snapshot stream, this property
121 needs to be unset using "zfs(1) inherit"
123 In order to avoid deletion of the previously backed up snapshot
124 necessary for sending incremental snapshot streams, the zfs-send
125 plugin instance places a "zfs(1) hold" on each backed up snapshot
126 using the following tag:
128 "org.opensolaris:time-slider-plugin:zfs-send"
130 Before attempting to commence a subsequent snapshot backup, a
131 hold is placed on the new snapshot using the above tag.
132 When the subsequent backup completes successfully, the hold on the
133 previous snapshot is released.
135 If a snapshot backup, either incremental or full fails for any reason,
136 the hold on the effected snapshots is not released. The administrator
137 will need to release these holds once the backup problem is fixed.
140 <instance name='zfs-send' enabled='false' >
141 <property_group name='general' type='framework'>
142 <propval name='action_authorization' type='astring'
143 value='solaris.smf.manage.zfs-auto-snapshot' />
144 <propval name='value_authorization' type='astring'
145 value='solaris.smf.manage.zfs-auto-snapshot' />
148 <property_group name="plugin" type="application">
149 <propval name="command"
150 type="astring" value="/usr/lib/time-slider/plugins/zfssend/zfssend" override="true"/>
153 <!-- Specify the command used to receive the snapshot stream.
154 The command will be executed via. pfexec(1).
156 "/usr/sbin/zfs receive -F -u -d backuppool"
157 would receive snapshots streams locally to "backupool", overwriting
158 any pre-existing clashing fileystems on homepool, would not attempt to
159 mount the fileystem. See zfs(1) for more details
162 <property_group name="receive" type="application">
163 <propval name="command"
164 type="astring" value="" override="true"/>
169 <instance name='rsync' enabled='false' >
174 exec='/lib/svc/method/time-slider-rsync start'
175 timeout_seconds='10'>
181 exec='/lib/svc/method/time-slider-rsync stop'
182 timeout_seconds='10'>
185 <property_group name='general' type='framework'>
186 <propval name='action_authorization' type='astring'
187 value='solaris.smf.manage.zfs-auto-snapshot' />
188 <propval name='value_authorization' type='astring'
189 value='solaris.smf.manage.zfs-auto-snapshot' />
192 <property_group name="plugin" type="application">
193 <propval name="trigger_command"
194 type="astring" value="/usr/lib/time-slider/plugins/rsync/rsync-trigger" override="true"/>
197 <property_group name="rsync" type="application">
198 <propval name="target_dir"
199 type="astring" value="" override="true"/>
200 <propval name="target_key"
201 type="astring" value='' override="true"/>
202 <!-- Backups matching a schedule in this list will not be
203 expired according to the standard auto-snapshot retention
204 rules, and will instead be archived indefinitely on
205 target_dir until it becomes necessary to delete them in
206 order to recover space on target_dir.
208 <propval name="archived_schedules"
209 type="astring" value="weekly,monthly" override="true"/>
210 <!-- Percentage of file system utilisation at which point
211 this plugin will start deleting indefinitely archived
212 backups in order to avoid the filesystem filling up
213 completely. Backups get deleted in reverse chronological
214 order. ie. oldest first until capacity falls back below
215 cleanup_threshold's value, or there is only 1 remaining
216 backup per fileystem remaining on the device, at which
219 <propval name="cleanup_threshold"
220 type="integer" value="95" override="true"/>
221 <!-- If set to true, instruct rsync to produce extra verbose
222 output using rsync's "-vv" command line option. Note that
223 this is independent of the generic <plugin/verbose>
224 property, which governs verbosity of the plugin itself
225 and not specifically rsync.
227 <propval name="verbose"
228 type="boolean" value="false" override="true"/>
232 <stability value='Unstable' />
236 <loctext xml:lang='C'>Time Slider Plugin Framework</loctext>
239 <loctext xml:lang='C'>
240 This service provides a mechanism for defining plugin actions for Time Slider
242 In order to use this service, you must enable the time-slider service plus at least one auto-snapshot
243 instance per set of automatic snapshots you want to take in addition to one or more Time Slider plugin
245 When enabled, the time-slider service will execute the command defined by the plugin's SMF property
246 "plugin/command" after it creates snapshot(s) according to an enabled auto-snapshot instance.
248 Time Slider provides the following environment variables for consumption by the plugin's defined command:
249 AUTOSNAP_LABEL: The last component of the snapshot(s) name(s) (the part after the @)
250 AUTOSNAP_FMRI: The full SMF FMRI of the auto-snapshot instance corresponding to AUTOSNAP_LABEL
251 PLUGIN_FMRI: The full SMF FMRI of the plugin instance associated with the invocation of the plugin command