Usage
CLI Overview
Note
The zrepl binary is self-documenting:
run zrepl help
for an overview of the available subcommands or zrepl SUBCOMMAND --help
for information on available flags, etc.
Subcommand |
Description |
---|---|
|
show subcommand overview |
|
run the daemon, required for all zrepl functionality |
|
show job activity, or with |
|
|
|
manually trigger replication + pruning of JOB |
|
manually abort current replication + pruning of JOB |
|
check if config can be parsed without errors |
|
perform on-disk state / ZFS property migrations
(see changelog for details)
|
|
list and remove zrepl’s abstractions on top of ZFS, e.g. holds and step bookmarks (see overview ) |
zrepl daemon
All actual work zrepl does is performed by a daemon process. The daemon supports structured logging and provides monitoring endpoints.
When installing from a package, the package maintainer should have provided an init script / systemd.service file. You should thus be able to start zrepl daemon using your init system.
Alternatively, or for running zrepl in the foreground, simply execute zrepl daemon
.
Note that you won’t see much output with the default logging configuration:
Attention
Make sure to actually monitor the error level output of zrepl: some configuration errors will not make the daemon exit.
Example: if the daemon cannot create the ssh+stdinserver Transport sockets in the runtime directory, it will emit an error message but not exit because other tasks such as periodic snapshots & pruning are of equal importance.
Restarting
The daemon handles SIGINT and SIGTERM for graceful shutdown. Graceful shutdown means at worst that a job will not be rescheduled for the next interval. The daemon exits as soon as all jobs have reported shut down.
Systemd Unit File
A systemd service definition template is available in dist/systemd. Note that some of the options only work on recent versions of systemd. Any help & improvements are very welcome, see issue #145.