Znapzend
services.znapzend.autoCreation
Automatically create the destination dataset if it does not exist.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.enable
Whether to enable ZnapZend ZFS backup daemon.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.compressed
Whether to enable compressed feature which adds the options -Lce
to
the {command}zfs send
command. When this is enabled, make
sure that both the sending and receiving pool have the same relevant
features enabled. Using -c
will skip unnecessary
decompress-compress stages, -L
is for large block
support and -e is for embedded data support. see
{manpage}znapzend(1)
and {manpage}zfs(8)
for more info
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.lowmemRecurse
Whether to enable use lowmemRecurse on systems where you have too many datasets, so a
recursive listing of attributes to find backup plans exhausts the
memory available to {command}znapzend
: instead, go the slower
way to first list all impacted dataset names, and then query their
configs one by one
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.oracleMode
Whether to enable destroying snapshots one by one instead of using one long argument list.
If source and destination are out of sync for a long time, you may have
so many snapshots to destroy that the argument gets is too long and the
command fails
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.recvu
Whether to enable recvu feature which uses -u
on the receiving end to keep the destination
filesystem unmounted
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.sendRaw
Whether to enable sendRaw feature which adds the options -w
to the
{command}zfs send
command. For encrypted source datasets this
instructs zfs not to decrypt before sending which results in a remote
backup that can't be read without the encryption key/passphrase, useful
when the remote isn't fully trusted or not physically secure. This
option must be used consistently, raw incrementals cannot be based on
non-raw snapshots and vice versa
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.skipIntermediates
Whether to enable the skipIntermediates feature to send a single increment
between latest common snapshot and the newly made one. It may skip
several source snaps if the destination was offline for some time, and
it should skip snapshots not managed by znapzend. Normally for online
destinations, the new snapshot is sent as soon as it is created on the
source, so there are no automatic increments to skip
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.features.zfsGetType
Whether to enable using zfsGetType if your {command}zfs get
supports a
-t
argument for filtering by dataset type at all AND
lists properties for snapshots by default when recursing, so that there
is too much data to process while searching for backup plans.
If these two conditions apply to your system, the time needed for a
--recursive
search for backup plans can literally
differ by hundreds of times (depending on the amount of snapshots in
that dataset tree... and a decent backup plan will ensure you have a lot
of those), so you would benefit from requesting this feature
.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.logLevel
The log level when logging to file. Any of debug, info, warning, err, alert. Default in daemonized form is debug.
Type: one of "debug", "info", "warning", "err", "alert"
Default
"debug"
Example
"warning"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.logTo
Where to log to (syslog::\<facility> or \<filepath>).
Type: string
Default
"syslog::daemon"
Example
"/var/log/znapzend.log"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.mailErrorSummaryTo
Email address to send a summary to if "send task(s) failed".
Type: (optionally newline-terminated) single-line string
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.noDestroy
Does all changes to the filesystem except destroy.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.pure
Do not persist any stateful znapzend setups. If this option is enabled, your previously set znapzend setups will be cleared and only the ones defined with this module will be applied.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup
Znapzend configuration.
Type: attribute set of (submodule)
Default
{ }
Example
{"tank/home" = {# Make snapshots of tank/home every hour, keep those for 1 day,# keep every days snapshot for 1 month, etc.plan = "1d=>1h,1m=>1d,1y=>1m";recursive = true;# Send all those snapshots to john@example.com:rtank/john as welldestinations.remote = {host = "john@example.com";dataset = "rtank/john";};};};
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.dataset
The dataset to use for this source.
Type: string
Example
"tank/home"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations
Additional destinations.
Type: attribute set of (submodule)
Default
{ }
Example
{local = {dataset = "btank/backup";presend = "zpool import -N btank";postsend = "zpool export btank";};remote = {host = "john@example.com";dataset = "tank/john";};};
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.dataset
Dataset name to send snapshots to.
Type: string
Example
"tank/main"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.host
Host to use for the destination dataset. Can be prefixed with
user@
to specify the ssh user.
Type: null or string
Default
null
Example
"john@example.com"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.label
Label for this destination. Defaults to the attribute name.
Type: string
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.plan
The znapzend backup plan to use for the source.
The plan specifies how often to backup and for how long to keep the backups. It consists of a series of retention periods to interval associations:
retA=>intA,retB=>intB,...
Both intervals and retention periods are expressed in standard units of time or multiples of them. You can use both the full name or a shortcut according to the following listing:
second|sec|s, minute|min, hour|h, day|d, week|w, month|mon|m, year|y
See {manpage}znapzendzetup(1)
for more info.
Type: string
Example
"1h=>10min,1d=>1h,1w=>1d,1m=>1w,1y=>1m"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.postsend
Command to run after sending the snapshot to the destination.
Intended to run a remote script via {command}ssh
on the
destination, e.g. to bring up a backup disk or server or to put a
zpool online/offline. See also {option}presend
.
Type: null or string
Default
null
Example
"ssh root@bserv zpool export tank"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.destinations.<name>.presend
Command to run before sending the snapshot to the destination.
Intended to run a remote script via {command}ssh
on the
destination, e.g. to bring up a backup disk or server or to put a
zpool online/offline. See also {option}postsend
.
Type: null or string
Default
null
Example
"ssh root@bserv zpool import -Nf tank"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.enable
Whether to enable this source.
Type: boolean
Default
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.mbuffer.enable
Whether to use {command}mbuffer
.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.mbuffer.port
Port to use for {command}mbuffer
.
If this is null, it will run {command}mbuffer
through
ssh.
If this is not null, it will run {command}mbuffer
directly through TCP, which is not encrypted but faster. In that
case the given port needs to be open on the destination host.
Type: null or 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.mbuffer.size
The size for {command}mbuffer
.
Supports the units b, k, M, G.
Type: string of the form number{b|k|M|G}
Default
"1G"
Example
"128M"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.plan
The znapzend backup plan to use for the source.
The plan specifies how often to backup and for how long to keep the backups. It consists of a series of retention periods to interval associations:
retA=>intA,retB=>intB,...
Both intervals and retention periods are expressed in standard units of time or multiples of them. You can use both the full name or a shortcut according to the following listing:
second|sec|s, minute|min, hour|h, day|d, week|w, month|mon|m, year|y
See {manpage}znapzendzetup(1)
for more info.
Type: string
Example
"1h=>10min,1d=>1h,1w=>1d,1m=>1w,1y=>1m"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.postsnap
Command to run after snapshots are taken on the source dataset,
e.g. for database unlocking. See also {option}presnap
.
Type: null or string
Default
null
Example
"${pkgs.coreutils}/bin/kill
${pkgs.coreutils}/bin/cat /tmp/mariadblock.pid;${pkgs.coreutils}/bin/rm /tmp/mariadblock.pid"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.presnap
Command to run before snapshots are taken on the source dataset,
e.g. for database locking/flushing. See also
{option}postsnap
.
Type: null or string
Default
null
Example
''${pkgs.mariadb}/bin/mysql -e "set autocommit=0;flush tables with read lock;\\! ${pkgs.coreutils}/bin/sleep 600" & ${pkgs.coreutils}/bin/echo $! > /tmp/mariadblock.pid ; sleep 10''
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.recursive
Whether to do recursive snapshots.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.sendDelay
Specify delay (in seconds) before sending snaps to the destination. May be useful if you want to control sending time.
Type: signed integer
Default
0
Example
60
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix
services.znapzend.zetup.<name>.timestampFormat
The timestamp format to use for constructing snapshot names.
The syntax is strftime
-like. The string must
consist of the mandatory %Y %m %d %H %M %S
.
Optionally - _ . :
characters as well as any
alphanumeric character are allowed. If suffixed by a
Z
, times will be in UTC.
Type: string containing all of the characters %Y, %m, %d, %H, %M, %S
Default
"%Y-%m-%d-%H%M%S"
Example
"znapzend-%m.%d.%Y-%H%M%SZ"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/znapzend.nix