2019-05-21 14:39:15 -04:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
2019-05-22 14:18:20 -04:00
|
|
|
targetNamespace="http://git.square-r00t.net/OpTools/tree/storage/backups/borg/"
|
|
|
|
xmlns="http://git.square-r00t.net/OpTools/tree/storage/backups/borg/"
|
|
|
|
xmlns:borg="http://git.square-r00t.net/OpTools/tree/storage/backups/borg/"
|
|
|
|
elementFormDefault="qualified"
|
2019-05-22 14:12:37 -04:00
|
|
|
attributeFormDefault="unqualified">
|
|
|
|
|
2019-05-21 14:39:15 -04:00
|
|
|
<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>
|
|
|
|
<xs:simpleType name="blocktext">
|
|
|
|
<xs:restriction base="xs:string">
|
|
|
|
<xs:whiteSpace value="preserve"/>
|
|
|
|
</xs:restriction>
|
|
|
|
</xs:simpleType>
|
2019-05-22 14:12:37 -04:00
|
|
|
|
2019-05-21 14:39:15 -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">
|
2019-05-23 02:46:05 -04:00
|
|
|
<!-- START PATH -->
|
2019-05-21 14:39:15 -04:00
|
|
|
<xs:element name="path" minOccurs="1"
|
|
|
|
maxOccurs="unbounded" type="xs:anyURI"/>
|
2019-05-23 02:46:05 -04:00
|
|
|
<!-- END PATH -->
|
|
|
|
<!-- START EXCLUDE -->
|
2019-05-21 14:39:15 -04:00
|
|
|
<xs:element name="exclude" minOccurs="0"
|
|
|
|
maxOccurs="unbounded" type="xs:anyURI"/>
|
2019-05-23 02:46:05 -04:00
|
|
|
<!-- END EXCLUDE -->
|
|
|
|
<!-- START PREP -->
|
2019-05-21 14:39:15 -04:00
|
|
|
<!-- 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" minOccurs="0"
|
|
|
|
maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base="borg:blocktext">
|
|
|
|
<xs:attribute name="inline" type="xs:boolean"
|
|
|
|
default="0"/>
|
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
2019-05-23 02:46:05 -04:00
|
|
|
<!-- END PREP -->
|
|
|
|
<!-- START PLUGIN -->
|
|
|
|
<xs:element name="plugins" minOccurs="0"
|
|
|
|
maxOccurs="1">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:sequence>
|
|
|
|
<xs:element name="plugin" minOccurs="1" maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:sequence>
|
|
|
|
<xs:element name="param" minOccurs="0"
|
|
|
|
maxOccurs="unbounded">
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base="borg: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>
|
|
|
|
</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>
|
|
|
|
</xs:sequence>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END PLUGIN -->
|
2019-05-21 14:39:15 -04:00
|
|
|
</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"/>
|
2019-05-24 13:37:40 -04:00
|
|
|
<xs:attribute name="compression" type="xs:token" use="optional"/>
|
2019-05-21 14:39:15 -04:00
|
|
|
</xs:complexType>
|
|
|
|
<xs:unique name="uniquePath">
|
|
|
|
<xs:selector xpath="borg: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"/>
|
2019-05-24 13:37:40 -04:00
|
|
|
<!-- "remote" is used to determine what type "target" is. -->
|
|
|
|
<xs:attribute name="remote" type="xs:boolean" use="required"/>
|
2019-05-21 14:39:15 -04:00
|
|
|
<!-- 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="borg:posixuser" use="optional"/>
|
|
|
|
</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="borg:server"/>
|
|
|
|
<xs:field xpath="@target"/>
|
|
|
|
</xs:unique>
|
|
|
|
</xs:element>
|
|
|
|
<!-- END ROOT -->
|
|
|
|
</xs:schema>
|