2019-06-05 21:47:31 -04:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2022-05-21 06:11:40 -04:00
|
|
|
<xs:schema targetNamespace="http://git.root2.io/r00t2/borgextend/"
|
|
|
|
xmlns="http://git.root2.io/r00t2/borgextend/"
|
|
|
|
xmlns:borg="http://git.root2.io/r00t2/borgextend/"
|
|
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
2019-06-05 21:47:31 -04:00
|
|
|
elementFormDefault="qualified"
|
|
|
|
attributeFormDefault="unqualified">
|
|
|
|
|
2022-05-21 06:11:40 -04:00
|
|
|
<!--
|
|
|
|
Sort of imported in from t_unix_posixUserGroup in http://xml.r00t2.io/schema/lib/types/unix.xsd
|
|
|
|
-->
|
|
|
|
<xs:simpleType name="posixuser">
|
|
|
|
<xs:restriction base="xs:token">
|
|
|
|
<xs:pattern value="[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}$)"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
2019-06-05 21:47:31 -04:00
|
|
|
|
2022-05-21 06:11:40 -04:00
|
|
|
<xs:simpleType name="blocktext">
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:whiteSpace value="preserve"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
|
|
|
|
|
|
|
<xs:complexType name="prepScript">
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base="blocktext">
|
|
|
|
<xs:attribute name="inline" use="optional" default="false" type="xs:boolean"/>
|
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
|
|
|
|
<xs:complexType name="param">
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base="blocktext">
|
|
|
|
<xs:attribute name="key"
|
|
|
|
type="xs:token"
|
|
|
|
use="required"/>
|
|
|
|
<xs:attribute name="json"
|
|
|
|
type="xs:boolean"
|
|
|
|
default="0"
|
|
|
|
use="optional"/>
|
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
|
2022-05-22 20:18:05 -04:00
|
|
|
|
2022-05-21 06:11:40 -04:00
|
|
|
<!-- START ROOT -->
|
|
|
|
<xs:element name="borg">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:choice>
|
|
|
|
<!-- START SERVER -->
|
|
|
|
<!-- This allows multiple backup destinations to be specified. -->
|
|
|
|
<xs:element name="server" minOccurs="1" maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:sequence>
|
|
|
|
<!-- START REPO -->
|
|
|
|
<xs:element name="repo" minOccurs="1" maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
2022-05-22 20:18:05 -04:00
|
|
|
<!-- START RETENTION POLICY -->
|
|
|
|
<!-- This is used to specify the per-repo retention *period* for pruning. -->
|
|
|
|
<xs:element name="keepWithin" minOccurs="0" maxOccurs="1" type="xs:duration"/>
|
|
|
|
<!-- This is used to specify more advanced retentions. -->
|
|
|
|
<xs:element name="keepLast" minOccurs="0" maxOccurs="1">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:choice minOccurs="1" maxOccurs="7">
|
|
|
|
<xs:element name="perSecond" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perMinute" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perHour" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perDay" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perWeek" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perMonth" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
<xs:element name="perYear" minOccurs="0" maxOccurs="1" type="xs:positiveInteger"/>
|
|
|
|
</xs:choice>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END RETENTION POLICY -->
|
2022-05-21 06:11:40 -04:00
|
|
|
<!-- START PATH -->
|
|
|
|
<xs:element name="path" minOccurs="1"
|
|
|
|
maxOccurs="unbounded" type="xs:anyURI"/>
|
|
|
|
<!-- END PATH -->
|
|
|
|
<!-- START EXCLUDE -->
|
|
|
|
<xs:element name="exclude" minOccurs="0"
|
|
|
|
maxOccurs="unbounded" type="xs:anyURI"/>
|
|
|
|
<!-- END EXCLUDE -->
|
|
|
|
<!-- START PREP -->
|
|
|
|
<!-- This gets messy. We essentially preserve whitespace, allowing
|
|
|
|
either an inline script to be executed (written to a temp file) or
|
|
|
|
a path to an external script/command to be specified. -->
|
|
|
|
<xs:element name="prep" type="prepScript" minOccurs="0"
|
|
|
|
maxOccurs="unbounded"/>
|
|
|
|
<!-- END PREP -->
|
|
|
|
<!-- START PLUGIN -->
|
|
|
|
<xs:element name="plugins" minOccurs="0"
|
|
|
|
maxOccurs="1">
|
|
|
|
<xs:complexType>
|
2019-06-05 21:47:31 -04:00
|
|
|
<xs:sequence>
|
2022-05-21 06:11:40 -04:00
|
|
|
<xs:element name="plugin" minOccurs="1" maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:sequence>
|
|
|
|
<xs:element name="param" minOccurs="0"
|
|
|
|
maxOccurs="unbounded" type="param">
|
|
|
|
</xs:element>
|
|
|
|
</xs:sequence>
|
|
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
|
|
<xs:attribute name="path" type="xs:anyURI" use="optional"/>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
2019-06-05 21:47:31 -04:00
|
|
|
</xs:sequence>
|
2022-05-21 06:11:40 -04:00
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END PLUGIN -->
|
|
|
|
</xs:choice>
|
|
|
|
<xs:attribute name="name" type="xs:token" use="required"/>
|
|
|
|
<!-- Optional. If not specified, the password will
|
|
|
|
be interactively (and securely) prompted for. -->
|
|
|
|
<xs:attribute name="password" type="xs:string" use="optional"/>
|
|
|
|
<xs:attribute name="compression" type="xs:token" use="optional"/>
|
|
|
|
<!-- This specifies if a repo is a "dummy" configuration.
|
|
|
|
Useful for testing and placeholder. -->
|
|
|
|
<xs:attribute name="dummy" type="xs:boolean" use="optional" default="false"/>
|
|
|
|
</xs:complexType>
|
|
|
|
<xs:unique name="uniquePath">
|
|
|
|
<xs:selector xpath="path"/>
|
|
|
|
<xs:field xpath="."/>
|
|
|
|
</xs:unique>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END REPO -->
|
|
|
|
</xs:sequence>
|
|
|
|
<!-- "target" should be either a local filesystem path or the remote hostname. -->
|
|
|
|
<!-- This should *not* contain a path if it's remote. If it does, you set up Borg wrong. -->
|
|
|
|
<xs:attribute name="target" type="xs:anyURI" use="required"/>
|
|
|
|
<!-- "remote" is used to determine what type "target" is. -->
|
|
|
|
<xs:attribute name="remote" type="xs:boolean" use="required"/>
|
|
|
|
<!-- Only used if "target" is a remote host. -->
|
|
|
|
<!-- See "BORG_RSH" at https://borgbackup.readthedocs.io/en/stable/usage/general.html -->
|
|
|
|
<xs:attribute name="rsh" type="xs:string" use="optional"/>
|
|
|
|
<!-- Only used if "target" is a remote host. -->
|
|
|
|
<!-- The remote host SSH user. -->
|
|
|
|
<xs:attribute name="user" type="posixuser" use="optional"/>
|
|
|
|
<!-- This specifies if a server is a "dummy" configuration.
|
|
|
|
Useful for testing and placeholder. -->
|
|
|
|
<xs:attribute name="dummy" type="xs:boolean" use="optional" default="false"/>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END SERVER -->
|
|
|
|
</xs:choice>
|
|
|
|
<xs:attribute name="borgpath" default="borg" use="optional"/>
|
|
|
|
</xs:complexType>
|
|
|
|
<xs:unique name="uniqueServer">
|
|
|
|
<xs:selector xpath="server"/>
|
|
|
|
<xs:field xpath="@target"/>
|
|
|
|
</xs:unique>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END ROOT -->
|
2019-06-05 21:47:31 -04:00
|
|
|
</xs:schema>
|