znapzendzetup - znapzend setup utility
znapzendzetup command [options...]
where 'command' is one of the following:
create [--recursive] [--mbuffer=<path>] [--mbuffersize=<size>] \
[--pre-snap-command=<command>] \
[--post-snap-command=<command>] \
[--tsformat=<format>] --donotask \
SRC plan dataset \
[ DST[:key] plan [[user@]host:]dataset ]
delete [--dst=key] <src_dataset>
edit [--recursive=on|off] [--mbuffer=<path>|off] [--mbuffersize=<size>] \
[--pre-snap-command=<command>|off] \
[--post-snap-command=<command>|off] \
[--tsformat=<format>] --donotask \
SRC [plan] dataset \
[ DST:key [plan] [dataset] ]
enable <src_dataset>
disable <src_dataset>
list [src_dataset]
help
man
Use znapzendsetup to configure your backup tasks. The cli is modled after the zfs commandline. Below a few notes on main commands.
The heart of the znapzend backup is the plan. The plan specifies how often to backup and for how long to keep the backups. A plan is required both for the source and the destination datasets.
The plan consists of a series of retention periodes 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 table:
second|sec|s
minute|min|M
hour|h
day|d
week|w
month|mon|m
year|y
To keep one copy every 30 minutes for one week, specify:
1week=>30min
To keep one copy every two days for 10 years:
10year=>2day
In a minimal setup, you just specify a plan for the SRC fileset. This will cause snapshots to be taken and destroyed according to the plan. You can then add one or several destinations (DST) both local (preferably on a different pool) or remote.
When adding multiple DST entries, each will get labled for later identification, optionally you can specify your own label.
- --tsformat=limited-strftime-format
-
The --tsformat option specifies how the names of the snapshots are constructed.
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 not specified, --tsformat defaults to
%Y-%m-%d-%H%M%S
. - --mbuffer=/usr/bin/mbuffer
-
Specify the path to your copy of the mbuffer utility.
- --mbuffersize=number{b|k|M|G}
-
The size of the mbuffer can be set with the --mbuffersize option. It supports the following units:
b, k, M, G
To specify a mbuffer size of 100MB:
--mbuffersize=100M
If not set, the buffer size defaults to 1GB.
- --donotask
-
Apply changes immediately. Without being asked if the config is as you intended it to be.
- --pre-snap-command=/path/bin args, --post-snap-command=/path/bin args
-
Run commands/scripts before and after snapshots are taken on source. e.g. for database locking/flushing (pre) and unlocking (post).
to remove configuration from a dataset just give its name
znapzendzetup I<dataset>
the delete function understands the following options
- --dst=key
-
to only remove a destination, specify the key of the destionation. Use the list function to see the keys.
modify the configuration of a dataset. see the descriptions in the create function for details.
znapzendzetup create -r --mbuffer=/opt/omni/bin/mbuffer \
--mbuffersize=1337M --tsformat='%Y-%m-%d-%H%M%S' \
--pre-snap-command="/bin/sh /usr/local/bin/lock_flush_db.sh" \
--post-snap-command="/bin/sh /usr/local/bin/unlock_db.sh" \
SRC '7d=>1h,30d=>4h,90d=>1d' tank/home \
DST:a '7d=>1h,30d=>4h,90d=>1d,1y=>1w,10y=>1month' backup/home \
DST:b '7d=>1h,30d=>4h,90d=>1d,1y=>1w,10y=>1month' root@bserv:backup/home
Copyright (c) 2014 by OETIKER+PARTNER AG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Tobias Oetiker <[email protected]> Dominik Hassler <[email protected]>
2014-07-22 had Pre and post snapshot commands 2014-06-29 had Flexible snapshot time format 2014-06-01 had Multi destination backup 2014-05-30 had Initial Version