repomirror/example.config.xml

159 lines
6.8 KiB
XML
Raw Normal View History

2020-06-13 03:46:49 -04:00
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is by default placed in ~/.config/repomirror.xml
2020-06-16 15:44:50 -04:00
Remember to replace any necessary special characters (https://stackoverflow.com/a/1091953/733214).
2020-06-13 03:46:49 -04:00
-->
<mirror xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://git.square-r00t.net/RepoMirror/"
xsi:schemaLocation="https://git.square-r00t.net/RepoMirror/ http://schema.xml.r00t2.io/projects/repomirror.xsd">
<distro name="arch">
2020-06-14 00:53:12 -04:00
<!--
If provided (and the sync script is running as the root user), the files/directories can be chowned to the
provided user/group. Otherwise they'll be owned by whatever user the script is running as (and its primary group).
-->
<owner>
<user>root</user>
<group>root</group>
</owner>
2020-06-13 03:46:49 -04:00
<!--
The local path to where the hierarchy/files should be synced to.
-->
<dest>/srv/repos/arch/.</dest>
<!--
2020-06-14 00:53:12 -04:00
The local file to update with a timestamp with the last time we *checked* for updates.
If not provided, don't update a file (NOT recommended!).
It may or may not be optional; check with the spec for mirroring for the specified distro.
If the timeFormat attribute is provided, write the timestamp format in the specified format.
See the following for details:
* https://docs.python.org/library/datetime.html#strftime-and-strptime-format-codes
* https://strftime.org/
The default is to use a regular UNIX Epoch integer (e.g. June 13, 2020 5:03:53 PM UTC => 1592067833).
This can be manually specified by the special string "UNIX_EPOCH".
2020-06-14 03:46:29 -04:00
Optionally, you can use the special string "MICROSECOND_EPOCH", which will specify the above with left-padded
microseconds (e.g. June 13, 2020 5:09:13.995777 PM UTC => 1592068153.995777).
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastLocalCheck timeFormat="MICROSECOND_EPOCH">/srv/http/arch.lastcheck</lastLocalCheck>
2020-06-13 03:46:49 -04:00
<!--
2020-06-14 00:53:12 -04:00
The file to update with a timestamp with the last time we *synced from our upstream*.
If not provided, don't update a file (NOT recommended!).
It may or may not be optional; check with the spec for mirroring for the specified distro.
If not provided, don't update a file (NOT recommended!).
It takes the same optional attribute "timeFormat" as above, with the same behaviour.
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastLocalSync timeFormat="UNIX_EPOCH">/srv/repos/arch/lastsync</lastLocalSync>
2020-06-13 03:46:49 -04:00
<!--
The path to a file on the upstream(s) that gives a time when it last updated.
2020-06-14 00:53:12 -04:00
The optional timeFormat attribute behavior is the same as above.
If neither this nor lastRemoteSync is provided, a sync will be attempted regardless of when the last one was
attempted.
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastRemoteUpdate timeFormat="UNIX_EPOCH">/lastupdate</lastRemoteUpdate>
2020-06-13 03:46:49 -04:00
<!--
The path to a file on the upstream(s) that gives a time when it last synced from its upstream.
2020-06-14 00:53:12 -04:00
The optional timeFormat attribute behavior is the same as above.
If neither this nor lastRemoteUpdate is provided, a sync will be attempted regardless of when the last one was
attempted.
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastRemoteSync timeFormat="UNIX_EPOCH">/lastsync</lastRemoteSync>
2020-06-13 03:46:49 -04:00
<!--
The path that must be currently mounted for sync to proceed.
2020-06-14 00:53:12 -04:00
This is required.
2020-06-13 03:46:49 -04:00
-->
<mountCheck>/</mountCheck>
<!--
2020-06-14 00:53:12 -04:00
You cannot reliably use two dashes in XML strings, so this is a workaround.
The following is only used for rsync upstreams and is optional. The default is the following:
<rsyncArgs>
<long>recursive</long>
<long>times</long>
<long>links</long>
<long>hard-links</long>
<long>delete-after</long>
<long>delay-updates</long>
<long>copy-links</long>
<long>safe-links</long>
2020-06-16 15:44:50 -04:00
<long>delete-excluded</long>
<long value=".*">exclude</long>
2020-06-17 01:18:16 -04:00
</rsyncArgs>
These arguments should be sane for most, if not all, rsync-driven repository mirroring. The last one (exclude) may
be removed in future versions.
2020-06-14 00:53:12 -04:00
If arguments are provided, the defaults are overwritten so if you need the above, be sure to specify them.
See the rsync man page (rsync(1)) for more details and a listing of supported flags on your system.
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<rsyncArgs>
<!--
A "long" option (two hyphens).
-->
<long>archive</long>
<long>delete-after</long>
<!--
2020-06-16 15:44:50 -04:00
An argument with a value (info=progress2).
2020-06-14 00:53:12 -04:00
-->
2020-06-16 15:44:50 -04:00
<long value="progress2">info</long>
2020-06-14 00:53:12 -04:00
<!--
A "short" option (single hyphen).
-->
<short>c</short><!-- checksum -->
</rsyncArgs>
2020-06-13 03:46:49 -04:00
<upstream>
<!--
The following example uses "rsync://arch.mirror.constant.com/archlinux/"
(https://www.archlinux.org/mirrors/constant.com/1008/)
2020-06-14 03:46:29 -04:00
If you need to find a mirror, you may be interested in the utils/find_fastest_upstream/ scripts. They will
automatically find (and sort based on connection speed) all mirrors in your country for a given distro.
They can even generate stubbed configuration files using those upstreams.
Currently only Arch Linux and CentOS are supported.
2020-06-13 03:46:49 -04:00
-->
<!--
2020-06-14 00:53:12 -04:00
Required; one of:
2020-06-13 03:46:49 -04:00
* rsync
* ftp
-->
<syncType>rsync</syncType>
<!--
Required; ONLY the domain (or IP) goes here.
2020-06-13 03:46:49 -04:00
-->
<domain>arch.mirror.constant.com</domain>
<!--
2020-06-14 00:53:12 -04:00
Optional; if not specified,the protocol's default port will be used.
2020-06-13 03:46:49 -04:00
-->
<port>873</port>
<!--
2020-06-14 00:53:12 -04:00
Required; the *remote* path part of the URI. The leading / is necessary. A trailing one will be assumed.
2020-06-13 03:46:49 -04:00
-->
<path>/archlinux/</path>
</upstream>
<!--
Multiple upstreams can be specified. They are tried in order specified and if connection fails or times out,
the next one will be tried until no more specified upstreams exist.
-->
<upstream>
<syncType>rsync</syncType>
<domain>arch.mirror.square-r00t.net</domain>
<path>/arch/</path>
</upstream>
<upstream>
<!--
Only passive (PASV) mode for FTP is supported.
-->
<syncType>ftp</syncType>
<domain>sub.domain.tld</domain>
<port>21</port>
<path>/distros/archlinux/</path>
</upstream>
</distro>
2020-06-14 00:53:12 -04:00
<distro name="centos">
<upstream>
<syncType>rsync</syncType>
<domain>mirrors.rit.edu</domain>
<path>/centos/</path>
</upstream>
2020-06-17 01:18:16 -04:00
<dest>/srv/repos/centos/.</dest>
2020-06-16 15:44:50 -04:00
<lastLocalCheck timeFormat="MICROSECOND_EPOCH">/srv/repos/centos/CHECKED</lastLocalCheck>
<lastLocalSync timeFormat="UNIX_EPOCH">/srv/repos/centos/TIME</lastLocalSync>
<lastRemoteUpdate timeFormat="%a %d %b %H:%M:%S UTC %Y">/timestamp.txt</lastRemoteUpdate>
<lastRemoteSync timeFormat="UNIX_EPOCH">/TIME</lastRemoteSync>
2020-06-17 01:18:16 -04:00
<mountCheck>/</mountCheck>
2020-06-14 00:53:12 -04:00
</distro>
2020-06-13 03:46:49 -04:00
</mirror>