Update README.md to specify the python requirements
[time-slider.git] / var / svc / manifest / application / time-slider-plugin.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
3 <!--
4
5  CDDL HEADER START
6
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
10  with the License.
11
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.
16
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]
22
23  CDDL HEADER END
24
25  Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26  Use is subject to license terms.
27
28 -->
29
30 <service_bundle type='manifest' name='SUNWgnome-time-slider'>
31
32 <service
33         name='application/time-slider/plugin'
34         type='service'
35         version='0.2.96'>
36
37         <!-- we need time-slider  -->
38         <dependency
39                 name='time-slider'
40                 grouping='require_all'
41                 restart_on='refresh'
42                 type='service'>
43                 <service_fmri value='svc:/application/time-slider' />
44         </dependency>
45
46         <!--
47             These are bare bones, basic plugin methods. More
48             complex plugin instances should define their own
49             specifically tailored start/stop/refresh methods.
50         -->
51         <exec_method
52                 type='method'
53                 name='start'
54                 exec='/lib/svc/method/time-slider-plugin start'
55                 timeout_seconds='10'>
56     </exec_method>
57
58         <exec_method
59                 type='method'
60                 name='stop'
61                 exec=':true'
62                 timeout_seconds='10'>
63         </exec_method>
64
65         <property_group name='startd' type='framework'>
66                 <propval name='duration' type='astring' value='transient' />
67         </property_group>
68
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' />
74         </property_group>
75
76
77         <!-- The properties we expect that any plugin instance will define:
78
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.
84
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
95          -->
96
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"/>
104         </property_group>
105
106
107         <!-- We now define a plugin instance: "zfs-send"
108              to perform "zfs(1) send" based backups--> 
109
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
113              zfs property:
114              "org.opensolaris:time-slider-plugin:zfs-send".
115
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"
122
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:
127              
128              "org.opensolaris:time-slider-plugin:zfs-send"
129              
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.
134
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. 
138         -->
139
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' />
146         </property_group>
147
148         <property_group name="plugin" type="application">
149                 <propval name="command"
150                         type="astring" value="/usr/lib/time-slider/plugins/zfssend/zfssend" override="true"/>
151         </property_group>
152
153         <!-- Specify the command used to receive the snapshot stream.
154              The command will be executed via. pfexec(1).
155              As an example:
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
160         -->
161
162         <property_group name="receive" type="application">
163                 <propval name="command"
164                         type="astring" value="" override="true"/>
165         </property_group>
166         </instance>
167
168
169         <instance name='rsync' enabled='false' >
170
171         <exec_method
172                 type='method'
173                 name='start'
174                 exec='/lib/svc/method/time-slider-rsync start'
175                 timeout_seconds='10'>
176     </exec_method>
177
178         <exec_method
179                 type='method'
180                 name='stop'
181                 exec='/lib/svc/method/time-slider-rsync stop'
182                 timeout_seconds='10'>
183         </exec_method>
184
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' />
190         </property_group>
191
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"/>
195         </property_group>
196
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.
207         -->
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
217              point it gives up.
218         -->
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.
226         -->
227                 <propval name="verbose"
228                         type="boolean" value="false" override="true"/>
229         </property_group>
230         </instance>
231
232         <stability value='Unstable' />
233
234         <template>
235                 <common_name>
236                         <loctext xml:lang='C'>Time Slider Plugin Framework</loctext>
237                 </common_name>
238                 <description>
239                         <loctext xml:lang='C'>
240 This service provides a mechanism for defining plugin actions for Time Slider
241
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
244 instnace.
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.
247
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
252                         </loctext>
253                 </description>
254         </template>
255 </service>
256 </service_bundle>