Skip to content

Commit bb56e2e

Browse files
committed
docs: Thu Feb 5 11:29:50 PM UTC 2026 - 4edfabd03062a8ac0184fcdbdd86a6ecdb5a1bb2
1 parent 74077e6 commit bb56e2e

717 files changed

Lines changed: 1172 additions & 112051 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildinfo

Lines changed: 0 additions & 4 deletions
This file was deleted.

.nojekyll

Whitespace-only changes.

_sources/changelog.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ Those changes will likely come with some breakage in the config.
4040
However, I want to avoid breaking **use cases** that are satisfied by the current design.
4141
There will be beta/RC releases to give users a chance to evaluate.
4242

43+
0.7.0 (unreleased)
44+
------------------
45+
46+
INCOMPLETE LIST OF CHANGES
47+
48+
* |maint| Update to Go 1.25 toolchain with Go 1.24 language level.
49+
* |maint| Fix deprecations exposed by the toolchain update.
50+
* |maint| Long-overdue update of all our dependencies & address deprecations.
51+
* |maint| Publish docs from ``master`` branch, retire ``stable`` branch.
52+
* |maint| The `make release-docker` in CircleCI produces executables that are bit-identical to my personal machine.
53+
4354
0.6.1
4455
-----
4556

_sources/configuration/overview.rst.txt

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,45 @@ Config File Structure
3030
A zrepl configuration file is divided in to two main sections: ``global`` and ``jobs``.
3131
``global`` has sensible defaults. It is covered in :ref:`logging <logging>`, :ref:`monitoring <monitoring>` \& :ref:`miscellaneous <miscellaneous>`.
3232

33+
34+
``conf.d``: including config files
35+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36+
37+
It is possible to distribute zrepl configurations over multiple YAML configuration
38+
files. This is achieved by using the `include` key which can only exist in the main
39+
configuration file.
40+
41+
The list of included paths must point to either individual YAML files or directories.
42+
If the path points to a directory then all YAML files with a `.yml` extention in the
43+
directory will be included.
44+
45+
.. code-block:: yaml
46+
47+
# /etc/zrepl/zrep.yml
48+
global: ...
49+
include:
50+
- ./jobs.d/
51+
- /opt/some_job.yml
52+
53+
# /etc/zrepl/jobs.d/backup.yml
54+
jobs:
55+
- name: backup
56+
type: push
57+
- ...
58+
59+
# /opt/some_job.yml
60+
jobs:
61+
- name: another_job
62+
...
63+
- ...
64+
65+
66+
67+
The paths are treated as absolute when starting with `/`, otherwise
68+
as a relative path to the main config file's parent directory.
69+
70+
Job names must be unique across all included configuration files.
71+
3372
.. _job-overview:
3473

3574
Jobs \& How They Work Together
@@ -130,7 +169,7 @@ The following high-level steps take place during replication and can be monitore
130169
* Move the **replication cursor** bookmark on the sending side (see below).
131170
* Move the **last-received-hold** on the receiving side (see below).
132171
* Release the send-side step-holds.
133-
172+
134173
The idea behind the execution order of replication steps is that if the sender snapshots all filesystems simultaneously at fixed intervals, the receiver will have all filesystems snapshotted at time ``T1`` before the first snapshot at ``T2 = T1 + $interval`` is replicated.
135174

136175
ZFS Background Knowledge
@@ -258,6 +297,9 @@ On your setup, ensure that
258297

259298
* all ``filesystems`` filter specifications are disjoint
260299
* no ``root_fs`` is a prefix or equal to another ``root_fs``
300+
301+
* For ``sink`` jobs, consider all possible ``root_fs/${client_identity}``.
302+
261303
* no ``filesystems`` filter matches any ``root_fs``
262304

263305
**Exceptions to the rule**:

_sources/configuration/prune.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Example Configuration:
5050
regex: "^manual_.*"
5151

5252
.. DANGER::
53+
5354
You might have **existing snapshots** of filesystems affected by pruning which you want to keep, i.e. not be destroyed by zrepl.
5455
Make sure to actually add the necessary ``regex`` keep rules on both sides, like with ``manual`` in the example above.
5556

@@ -71,6 +72,14 @@ It only makes sense to specify this rule for the ``keep_sender``.
7172
The reason is that, by definition, all snapshots on the receiver have already been replicated to there from the sender.
7273
To determine whether a sender-side snapshot has already been replicated, zrepl uses the :ref:`replication cursor bookmark <replication-cursor-and-last-received-hold>` which corresponds to the most recent successfully replicated snapshot.
7374

75+
.. ATTENTION::
76+
77+
If you use ``not_replicated`` in your pruning rules, make sure to :ref:`monitor <monitoring>` replication.
78+
If your replication gets stuck then ``not_replicated`` causes snapshots to pile uip on the sender.
79+
ZFS and especially the ``zfs`` management command are known to degrade in performance with a lot of snapshots.
80+
Such degradation impacts zrepl, any other scripts, and human ability to manage your zpool.
81+
82+
7483
.. _prune-keep-retention-grid:
7584

7685
Policy ``grid``

_sources/configuration/sendrecvoptions.rst.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Send Options
1212
:ref:`Source<job-source>` and :ref:`push<job-push>` jobs have an optional ``send`` configuration section.
1313

1414
::
15-
15+
1616
jobs:
1717
- type: push
1818
filesystems: ...
@@ -84,8 +84,8 @@ If ``encrypted=false``, zrepl expects that filesystems matching ``filesystems``
8484

8585
.. _job-send-options-properties:
8686

87-
``properties``
88-
--------------
87+
``send_properties``
88+
-------------------
8989
Sends the dataset properties along with snapshots.
9090
Please be careful with this option and read the :ref:`note on property replication below <job-note-property-replication>`.
9191

@@ -171,7 +171,7 @@ You can send the original properties from the first receiver to another receiver
171171
A Note on Property Replication
172172
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173173

174-
If a send stream contains properties, as per ``send.properties`` or ``send.backup_properties``,
174+
If a send stream contains properties, as per ``send.send_properties`` or ``send.backup_properties``,
175175
the default ZFS behavior is to use those properties on the receiving side, verbatim.
176176

177177
In many use cases for zrepl, this can have devastating consequences.
@@ -221,6 +221,14 @@ and property replication is enabled, the receiver must :ref:`inherit the followi
221221
* ``keyformat``
222222
* ``encryption``
223223

224+
Sharing
225+
-------
226+
227+
You may not want the replicated filesystem shared in the same way as the source is.
228+
229+
* ``sharenfs``
230+
* ``sharesmb``
231+
224232
.. _job-recv-options--placeholder:
225233

226234
Placeholders

_sources/configuration/snapshotting.rst.txt

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ The following snapshotting types are supported:
2525

2626
The ``periodic`` and ``cron`` snapshotting types share some common options and behavior:
2727

28-
* **Naming:** The snapshot names are composed of a user-defined ``prefix`` followed by a UTC date formatted like ``20060102_150405_000``.
29-
We use UTC because it will avoid name conflicts when switching time zones or between summer and winter time.
28+
* **Naming:** The snapshot names are composed of a user-defined ``prefix`` followed by a UTC date formatted like ``20060102_150405_000`` by default.
29+
We either use UTC or timestamp with timezone information because it will avoid name conflicts when switching time zones or between summer and winter time.
30+
Note that if timestamp with time zone information is used, the "+" of the timezone (i.e. +02:00) is replaced by "_" (i.e. _02:00) to conform to allowed characters in ZFS snapshots.
3031
* **Hooks:** You can configure hooks to run before or after zrepl takes the snapshots. See :ref:`below <job-snapshotting-hooks>` for details.
3132
* **Push replication:** After creating all snapshots, the snapshotter will wake up the replication part of the job, if it's a ``push`` job.
3233
Note that snapshotting is decoupled from replication, i.e., if it is down or takes too long, snapshots will still be taken.
@@ -65,6 +66,9 @@ The ``periodic`` and ``cron`` snapshotting types share some common options and b
6566
# Timestamp format that is used as snapshot suffix.
6667
# Can be any of "dense" (default), "human", "iso-8601", "unix-seconds" or a custom Go time format (see https://go.dev/src/time/format.go)
6768
timestamp_format: dense
69+
# Specifies in which time zone the snapshot suffix is generated, optional, defaults to UTC, used only if time zone information is part of timestamp_format.
70+
# Can be "UTC" (default), "Local" (time zone information from the OS) or any of the IANA Time Zone names (see https://nodatime.org/TimeZones)
71+
timestamp_location: UTC
6872
hooks: ...
6973
pruning: ...
7074

@@ -97,27 +101,16 @@ The snapshotter uses the ``prefix`` to identify which snapshots it created.
97101
# Timestamp format that is used as snapshot suffix.
98102
# Can be any of "dense" (default), "human", "iso-8601", "unix-seconds" or a custom Go time format (see https://go.dev/src/time/format.go)
99103
timestamp_format: dense
104+
# Specifies in which time zone the snapshot suffix is generated, optional, defaults to UTC, used only if time zone information is part of timestamp_format.
105+
# Can be "UTC" (default), "Local" (time zone information from the OS) or any of the IANA Time Zone names (see https://nodatime.org/TimeZones)
106+
timestamp_location: UTC
100107
pruning: ...
101108

102109
In ``cron`` mode, the snapshotter takes snaphots at fixed points in time.
103110
See https://en.wikipedia.org/wiki/Cron for details on the syntax.
104111
zrepl uses the ``the github.com/robfig/cron/v3`` Go package for parsing.
105112
An optional field for "seconds" is supported to take snapshots at sub-minute frequencies.
106113

107-
.. _job-snapshotting-timestamp_format:
108-
109-
Timestamp Format
110-
~~~~~~~~~~~~~~~~
111-
112-
The ``cron`` and ``periodic`` snapshotter support configuring a custom timestamp format that is used as suffix for the snapshot name.
113-
It can be used by setting ``timestamp_format`` to any of the following values:
114-
115-
* ``dense`` (default) looks like ``20060102_150405_000``
116-
* ``human`` looks like ``2006-01-02_15:04:05``
117-
* ``iso-8601`` looks like ``2006-01-02T15:04:05.000Z``
118-
* ``unix-seconds`` looks like ``1136214245``
119-
* Any custom Go time format accepted by `time.Time#Format <https://go.dev/src/time/format.go>`_.
120-
121114

122115
``manual`` Snapshotting
123116
-----------------------
@@ -137,6 +130,33 @@ See :ref:`this quickstart guide <quickstart-backup-to-external-disk>` for an exa
137130

138131
To trigger replication after taking snapshots, use the ``zrepl signal wakeup JOB`` command.
139132

133+
.. _job-snapshotting-timestamp_format:
134+
135+
Timestamp Format
136+
----------------
137+
138+
The ``cron`` and ``periodic`` snapshotter support configuring a custom timestamp format that is used as suffix for the snapshot name.
139+
140+
By default, the current time is converted to UTC and then formatted using the ``dense`` format.
141+
142+
Both time zone and format can be customized by setting ``timestamp_format`` and/or ``timestamp_location``.
143+
144+
``timestamp_location`` is fed verbatim into `time.LoadLocation <https://pkg.go.dev/time#LoadLocation>`_.
145+
146+
``timestamp_format`` supports the following values (case-insensitive).
147+
148+
* ``dense`` => Go format string ``20060102_150405_000``
149+
* ``human`` => Go format string ``2006-01-02_15:04:05``
150+
* ``iso-8601`` => Go format string ``2006-01-02T15:04:05.000Z07:00``
151+
* ``unix-seconds`` => Unix seconds since the epoch, formatted as a decimal string (`time.Time.Unix <https://pkg.go.dev/time#Time.Unix>`_)
152+
* Any custom Go time format accepted by `time.Time#Format <https://go.dev/src/time/format.go>`_.
153+
154+
The ``dense``, ``human``, and ``unix-seconds`` formats require the ``timestamp_location`` to be ``UTC`` because they do not contain timezone information.
155+
156+
The ``+`` character is `not allowed in ZFS snapshot names <https://github.com/openzfs/zfs/blob/1d3ba0bf01020f5459b1c28db3979129088924c0/module/zcommon/zfs_namecheck.c#L334-L351>`_.
157+
Format strings are disallowed to contain the ``+`` character (it's not a character that is interpreted by ``time.Time.Format``, so there's no reason to use it).
158+
If a format _produces_ a ``+``, that ``+`` is replaced by an `_`` character.
159+
140160
.. _job-snapshotting-hooks:
141161

142162
Pre- and Post-Snapshot Hooks
@@ -173,7 +193,7 @@ Most hook types take additional parameters, please refer to the respective subse
173193
* - ``mysql-lock-tables``
174194
- :ref:`Details <job-hook-type-mysql-lock-tables>`
175195
- Flush and read-Lock MySQL tables while taking the snapshot.
176-
196+
177197
.. _job-hook-type-command:
178198

179199
``command`` Hooks

_sources/configuration/transports.rst.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The connection fails if either do not match.
165165
Mutual-TLS between Two Machines
166166
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167167

168-
However, for a two-machine setup, self-signed certificates distributed using an out-of-band mechanism will also work just fine:
168+
For a two-machine setup, self-signed certificates distributed using an out-of-band mechanism will also work just fine:
169169

170170
Suppose you have a push-mode setup, with `backups.example.com` running the :ref:`sink job <job-sink>`, and `prod.example.com` running the :ref:`push job <job-push>`.
171171
Run the following OpenSSL commands on each host, substituting HOSTNAME in both filenames and the interactive input prompt by OpenSSL:
@@ -218,19 +218,19 @@ Tools like `EasyRSA <https://github.com/OpenVPN/easy-rsa>`_ make this very easy:
218218
#!/usr/bin/env bash
219219
set -euo pipefail
220220

221-
HOSTS=(backupserver prod1 prod2 prod3)
221+
HOSTS=(backupserver prod1 prod2 prod3 10.23.42.1)
222222

223-
curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz > EasyRSA-3.0.7.tgz
224-
echo "157d2e8c115c3ad070c1b2641a4c9191e06a32a8e50971847a718251eeb510a8 EasyRSA-3.0.7.tgz" | sha256sum -c
225-
rm -rf EasyRSA-3.0.7
226-
tar -xf EasyRSA-3.0.7.tgz
227-
cd EasyRSA-3.0.7
228-
./easyrsa
229-
./easyrsa init-pki
230-
./easyrsa build-ca nopass
223+
curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.2.5/EasyRSA-3.2.5.tgz > EasyRSA-3.2.5.tgz
224+
echo "662ee3b453155aeb1dff7096ec052cd83176c460cfa82ac130ef8568ec4df490 EasyRSA-3.2.5.tgz" | sha256sum -c
225+
rm -rf EasyRSA-3.2.5
226+
tar -xf EasyRSA-3.2.5.tgz
227+
cd EasyRSA-3.2.5
228+
./easyrsa --batch
229+
./easyrsa --batch init-pki
230+
./easyrsa --batch build-ca nopass
231231

232232
for host in "${HOSTS[@]}"; do
233-
./easyrsa build-serverClient-full $host nopass
233+
./easyrsa --batch --auto-san build-serverClient-full $host nopass
234234
echo cert for host $host available at pki/issued/$host.crt
235235
echo key for host $host available at pki/private/$host.key
236236
done

_sources/installation.rst.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ Installation
1111

1212
.. toctree::
1313

14-
installation/user-privileges
1514
installation/packages
1615
installation/apt-repos
1716
installation/rpm-repos
18-
installation/compile-from-source
17+
installation/user-privileges
1918
installation/freebsd-jail-with-iocage
2019
installation/what-next

_sources/installation/compile-from-source.rst.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)