Skip to content

Commit

Permalink
Update documentation for PR #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Jehops committed Jun 14, 2021
1 parent 1fb8a3e commit ff93135
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
** Overview
zap automates the management of zfs snapshots. With a few crontab entries, it can be used to create a comprehensive zfs backup system. There are no configuration files. All parameters are supplied on the command line or in zfs properties and all snapshot information is stored in snapshot names.
zap automates the management of zfs snapshots. With a few crontab entries, it can be used to create a comprehensive zfs backup system. There are no configuration files. Parameters are supplied on the command line or in zfs properties and all snapshot information is stored in snapshot names.

zap will not interfere with manually created snapshots or snapshots from other tools. It will only operate on snapshots it creates.

Expand Down Expand Up @@ -37,10 +37,10 @@
#+BEGIN_SRC sh
# zap rep zap@bravo:rback/phe -r zroot/ROOT zroot/usr/home/jrm
#+END_SRC
Replicate datasets that originated from the host awarnach to the remote host bravo, under the zback/phe dataset. If you use a non-default ssh port, specify it in =~/.ssh/config=.
Replicate datasets that originated from the host awarnach to the remote host bravo, under the zback/phe dataset. If you use a non-default ssh port, specify it in =~/.ssh/config=. Filter the transfer through =~mbuffer~= by setting the =~ZAP_FILTER~= environment variable. Note that =~mbuffer~= must be installed on both the sending and receiving hosts.
#+BEGIN_SRC sh
# zfs set zap:rep='zap@bravo:zback/phe' zroot/ROOT zroot/usr/home/jrm
# zap rep -v -h awarnach
# ZAP_FILTER="mbuffer -s 128k -m 10M" zap rep -v -h awarnach
#+END_SRC
Destroy expired snapshots. Be verbose.
#+BEGIN_SRC sh
Expand Down Expand Up @@ -83,7 +83,7 @@

=rep= | =replicate=

Use the =rep= subcommand to replicate datasets. If a destination and datasets are not supplied on the command line, datasets with a destination set in the =zap:rep= user property are replicated. If the destination does not contain a =host=, or if the supplied host is one of =localhost=, =127.x.x.x=, or =::1=, then any =user@= is ignored and =ssh= is not be used. If the =canmount= property of the local dataset is set to =on=, after replication an attempt is made to set =canmount= to =noauto= on the remote side. This is done to prevent mountpoint collisions.
Use the =rep= subcommand to replicate datasets. If a destination and datasets are not supplied on the command line, datasets with a destination set in the =zap:rep= user property are replicated. If the destination does not contain a =host=, or if the supplied host is one of =localhost=, =127.x.x.x=, or =::1=, then any =user@= is ignored and =ssh= is not be used. If the =canmount= property of the local dataset is set to =on=, after replication an attempt is made to set =canmount= to =noauto= on the remote side. This is done to prevent mountpoint collisions. Set the =~ZAP_FILTER~= environment variable to a command to filter the transfer. For example, =~ZAP_FILTER="mbuffer -s 128k -m 10M"~= will filter the transfer through =~mbuffer~=. Note that the filter command must be installed on both the sending and receiving hosts.

=destroy=

Expand Down
24 changes: 22 additions & 2 deletions zap.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.Dd May 9, 2021
.Dd June 14, 2021
.Dt ZAP 1
.Os
.Sh NAME
Expand Down Expand Up @@ -101,6 +101,11 @@ snapshots originating from the local host (as returned by
.Ic -h host
can be used to replicate snapshots originating from
.Ic host Ns .
Set the ZAP_FILTER environment variable to a command to filter the transfer.
For example, ZAP_FILTER="mbuffer -s 128k -m 10M" will filter the transfer
through mbuffer.
Note that the filter command must be available on both the sending and receiving
hosts.
.Pp
.Ss Ar destroy
Use the
Expand Down Expand Up @@ -161,6 +166,17 @@ Recursively create or replicate snapshots of all descendants.
.It Fl v
Be verbose.
.El
.Sh ENVIRONMENT
The following environment variable affects the execution of
.Nm :
.Bl -tag -width ".Ev CLICOLOR_FORCE"
.It Ev ZAP_FILTER
Filter
.Ar rep
through the command contained in the variable. For example, a value of "mbuffer
-s 128k -m 10M" will filter the transfer through mbuffer. Note that the filter
command must be available on both the sending and receiving hosts.
.El
.Sh EXAMPLES
Create snapshots that will expire after three weeks.
.Bd -literal -offset indent
Expand Down Expand Up @@ -196,7 +212,9 @@ zap rep zap@bravo:rback/phe -r zroot/ROOT zroot/usr/home/jrm
.Pp
Replicate datasets originating from awarnach to the remote host bravo, under the
zback/phe dataset. If you use a non-default ssh port, specify it in
~/.ssh/config.
~/.ssh/config. Filter the transfer through mbuffer by setting the ZAP_FILTER
environment variable. Note that mbuffer must be available on both the sending
and receiving hosts.
.Bd -literal -offset indent
zfs set zap:rep='zap@bravo:zback/phe' zroot/ROOT zroot/usr/home/jrm
zap rep -v -h awarnach
Expand Down Expand Up @@ -245,6 +263,8 @@ disks, so only do it every 24 hours.
.It An David Samms Mt dsamms@nw-ds.com
.It An Victor Naumov Mt vicnaumov@gmail.com
.It An Dries Michiels Mt driesm.michiels@gmail.com
.It An Louis Kowolowski Mt louisk@cryptomonkeys.org
.It An Maxime Soul\('e
.El
.Sh BUGS
.Lk http://github.com/jehops/zap/issues Issue tracker

0 comments on commit ff93135

Please sign in to comment.