5.4 KiB
+++ title = "Job Types" weight = 10 +++
A job is the unit of activity tracked by the zrepl daemon and configured in the [configuration file]({{< relref "install/_index.md#configuration-files" >}}).
Every job has a unique name, a type and type-dependent fields which are documented on this page.
Check out the [tutorial]({{< relref "tutorial/_index.md" >}}) and {{< sampleconflink >}} for examples on how job types are actually used.
Job Types
{{% notice info %}}
Currently, zrepl does not replicate filesystem properties.
Whe receiving a filesystem, it is never mounted (-u flag) and mountpoint=none is set.
This is temporary and being worked on {{< zrepl-issue 24 >}}.
{{% / notice %}}
Source
| Parameter | Default | Description / Example |
|---|---|---|
type |
source |
|
name |
unique name of the job | |
serve |
{{< zrepl-transport "serve transport" >}} specification | |
datasets |
{{< zrepl-filter >}} for datasets to expose to client | |
snapshot_prefix |
prefix for ZFS snapshots taken by this job | |
interval |
snapshotting interval | |
prune |
{{< zrepl-prune >}} policy for datasets in datasets with prefix snapshot_prefix |
- Snapshotting Task (every
interval, {{% zrepl-job-patient %}})- A snapshot of filesystems matched by
datasetsis taken everyintervalwith prefixsnapshot_prefix. - The
prunepolicy is triggered on datasets matched bydatasetswith snapshots matched bysnapshot_prefix.
- A snapshot of filesystems matched by
- Serve Task
- Wait for connections from pull job using
serve
- Wait for connections from pull job using
A source job is the counterpart to a [pull job]({{< relref "#pull" >}}).
Note that the prune policy determines the maximum replication lag: a pull job may stop replication due to link failure, misconfiguration or administrative action. The source prune policy will eventually destroy the last common snapshot between source and pull job, requiring full replication. Make sure you read the [prune policy documentation]({{< relref "configuration/prune.md" >}}).
Example: {{< sampleconflink "pullbackup/productionhost.yml" >}}
Pull
| Parameter | Default | Description / Example |
|---|---|---|
type |
pull |
|
name |
unique name of the job | |
connect |
{{< zrepl-transport "connect transport" >}} specification | |
interval |
Interval between pull attempts | |
mapping |
{{< zrepl-mapping >}} for remote to local filesystems | |
initial_repl_policy |
most_recent |
initial replication policy |
snapshot_prefix |
prefix filter used for replication & pruning | |
prune |
{{< zrepl-prune >}} policy for local filesystems reachable by mapping |
- Main Task (every
interval, {{% zrepl-job-patient %}})- A connection to the remote source job is established using the strategy in
connect mappingmaps filesystems presented by the remote side to local target filesystems- Those remote filesystems with a local target filesystem are replicated:
- Only snapshots with prefix
snapshot_prefixare replicated. - If possible, incremental replication takes place.
- If the local target filesystem does not exist,
initial_repl_policyis used. - On conflicts, an error is logged but replication of other filesystems with mapping continues.
- Only snapshots with prefix
- The
prunepolicy is triggered for all target filesystems
- A connection to the remote source job is established using the strategy in
A pull job is the counterpart to a [source job]({{< relref "#source" >}}).
Example: {{< sampleconflink "pullbackup/backuphost.yml" >}}
Local
| Parameter | Default | Description / Example |
|---|---|---|
type |
local |
|
name |
unique name of the job | |
mapping |
{{}} from source to target filesystem (both local) | |
snapshot_prefix |
prefix for ZFS snapshots taken by this job | |
interval |
snapshotting & replication interval | |
initial_repl_policy |
most_recent |
initial replication policy |
prune_lhs |
pruning policy on left-hand-side (source) | |
prune_rhs |
pruning policy on right-hand-side (target) |
- Main Task (every
interval, {{% zrepl-job-patient %}})- Evaluate
mappingfor local filesystems, those with a target filesystem are called mapped filesystems. - Snapshot mapped filesystems with
snapshot_prefix. - Replicate mapped filesystems to their respective target filesystems:
- Only snapshots with prefix
snapshot_prefixare replicated. - If possible, incremental replication takes place.
- If the target filesystem does not exist,
initial_repl_policyis used. - On conflicts, an error is logged but replication of other mapped filesystems continues.
- Only snapshots with prefix
- The
prune_lhspolicy is triggered for all mapped filesystems - The
prune_rhspolicy is triggered for all target filesystems
- Evaluate
A local job is combination of source & pull job executed on the same machine.
Example: {{< sampleconflink "localbackup/host1.yml" >}}
Glossary
Task
A job consists of one or more tasks and a task consists of one or more steps. Some tasks may be periodic while others wait for an event to occur.
patient
it is supposed to execute some task every interval.
We call the start of the task an invocation.
- If the task completes in less than
interval, the task is restarted atlast_invocation + interval. - Otherwise, a patient job
- logs a warning as soon as a task exceeds its configured
interval - waits for the last invocation to finish
- logs a warning with the effective task duration
- immediately starts a new invocation of the task
- logs a warning as soon as a task exceeds its configured