2017-05-23 20:59:40 +02:00
|
|
|
# zsnapper sample configuration
|
2017-05-21 22:33:57 +02:00
|
|
|
|
2017-05-23 20:59:40 +02:00
|
|
|
# Each section is the name of a ZFS file system
|
|
|
|
# All settings are applied recursively to all file system descendants
|
|
|
|
#
|
2017-05-21 22:33:57 +02:00
|
|
|
[tank]
|
2017-05-23 20:59:40 +02:00
|
|
|
# Frequency of snapshots
|
|
|
|
# Set to empty value to disable snapshoting
|
|
|
|
#
|
|
|
|
# Interval units are 'd', 'h' and 'm' for days, hours and minutes.
|
|
|
|
# they can also be combined if you for example wants a snapshot taken every 1 and a half days:
|
|
|
|
;snapshot_interval=1d 12h
|
2017-05-21 22:33:57 +02:00
|
|
|
snapshot_interval=1h
|
2017-05-22 21:25:51 +02:00
|
|
|
|
|
|
|
# Remote replication
|
2017-05-23 20:59:40 +02:00
|
|
|
# possible other value is 'latest' to only sync the latest snapshot
|
|
|
|
# Set to empty value to not send the snapshots to remote
|
2018-12-27 15:09:43 +01:00
|
|
|
send_enable=all
|
2017-05-22 21:25:51 +02:00
|
|
|
|
2018-12-27 15:09:43 +01:00
|
|
|
# source_zfs_cmd is the command to execute zfs locally.
|
|
|
|
# The target_zfs_cmd option is the command to use to execute zfs on target machine.
|
|
|
|
# target_test_cmd, if set, is executed before trying to send any snapshot to remote.
|
|
|
|
# If target_test_cmd returns a non-zero status the remote is considered to be unavailable
|
2017-05-23 20:59:40 +02:00
|
|
|
# and no snapshots are sent. (A warning is written in the log though)
|
|
|
|
#
|
2017-05-21 22:33:57 +02:00
|
|
|
# NOTE:
|
2017-05-23 20:59:40 +02:00
|
|
|
# The command arguments must not contain whitespace characters, due to implementation details.
|
|
|
|
#
|
2018-12-27 15:09:43 +01:00
|
|
|
# Variables can be used in target_zfs_cmd and target_test_cmd. Any setting
|
2017-05-23 20:59:40 +02:00
|
|
|
# available in the section can be used as a variable
|
2018-12-27 15:09:43 +01:00
|
|
|
source_zfs_cmd=/usr/bin/sudo /sbin/zfs
|
|
|
|
target_zfs_cmd=/usr/bin/ssh ${target_user}@${target_host} /usr/bin/sudo /sbin/zfs
|
|
|
|
target_test_cmd=/usr/bin/ssh ${target_user}@${target_host} echo "success"
|
|
|
|
# The target_host option is optional but recommended if you send snapshots to a remote host.
|
|
|
|
target_host=my.backup.server.tld
|
|
|
|
# target_user is not a actually a zsnapper option; but it's used as a variable in the remote commands.
|
|
|
|
target_user=backup
|
2017-05-23 20:59:40 +02:00
|
|
|
|
2018-12-27 15:09:43 +01:00
|
|
|
# target_fs is the file system on the receiving side that should receive zfs sends
|
2017-05-23 20:59:40 +02:00
|
|
|
# for this file system.
|
|
|
|
# NOTE:
|
|
|
|
# Just like any other option this is inherited by file system descendants,
|
2018-12-27 15:09:43 +01:00
|
|
|
# but if a child has the same target_zfs_target as the parent, the child
|
2017-05-23 20:59:40 +02:00
|
|
|
# will instead use this to figure out where the parent is and be sent to
|
|
|
|
# it position relative to the parent.
|
|
|
|
# For example: The local file system tank/ROOT will be sent to tank/backup/client/ROOT.
|
2018-12-27 15:09:43 +01:00
|
|
|
target_fs=tank/backup/client
|
2017-05-23 20:59:40 +02:00
|
|
|
|
2017-05-22 21:25:51 +02:00
|
|
|
# These can be set to use custom arguments to zfs send and zfs receive
|
2018-12-27 15:09:43 +01:00
|
|
|
send_flags=-D -p
|
|
|
|
recv_flags=
|
2017-05-21 22:33:57 +02:00
|
|
|
|
2017-05-23 20:59:40 +02:00
|
|
|
# snapshot weeding
|
|
|
|
# set weed_enable to an empty value to disable snapshot weeding.
|
|
|
|
# NOTE:
|
|
|
|
# If weeding is enabled but no keep_<time> setting is configured all
|
|
|
|
# your snapshots, except the latest, will be removed. Make sure to
|
|
|
|
# configure your weeding settings carefully.
|
|
|
|
weed_enable=1
|
2017-05-21 22:33:57 +02:00
|
|
|
keep_hourly=24
|
2017-05-22 21:25:51 +02:00
|
|
|
keep_daily=7
|
2017-05-21 22:33:57 +02:00
|
|
|
keep_weekly=4
|
|
|
|
keep_monthly=4
|
|
|
|
|
|
|
|
|
|
|
|
[tank/SWAP]
|
|
|
|
snapshot_interval=
|
2018-12-27 15:09:43 +01:00
|
|
|
send_enable=
|
2017-05-21 22:33:57 +02:00
|
|
|
|
|
|
|
[tank/media]
|
2017-05-23 20:59:40 +02:00
|
|
|
snapshot_interval=
|
2018-12-27 15:09:43 +01:00
|
|
|
send_enable=
|
2017-05-21 22:33:57 +02:00
|
|
|
|
|
|
|
[tank/tmp]
|
|
|
|
snapshot_interval=
|
2018-12-27 15:09:43 +01:00
|
|
|
send_enable=
|
2017-05-21 22:33:57 +02:00
|
|
|
|
|
|
|
[tank/var/log]
|
|
|
|
snapshot_interval=1m
|
2017-05-22 21:25:51 +02:00
|
|
|
keep_1min=5
|
|
|
|
keep_15min=4
|
2017-05-21 22:33:57 +02:00
|
|
|
|
|
|
|
[tank/var/tmp]
|
|
|
|
snapshot_interval=
|
2018-12-27 15:09:43 +01:00
|
|
|
send_enable=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# '@' in the section title indicates that this file system is not local
|
|
|
|
# note that the *_zfs_cmd settings.
|
|
|
|
#
|
|
|
|
# The remote snapshots are only created *after* the local, after zsnapper
|
|
|
|
# has aquired the execution lock, so if zsnapper takes a long time to execute
|
|
|
|
# some snapshotting may be delayed.
|
|
|
|
#
|
|
|
|
# the '@' is required since zsnapper otherwise have no way to know which
|
|
|
|
# filesystems are on the same server...
|
|
|
|
[zroot/backup@remote_system1]
|
|
|
|
source_zfs_cmd=/usr/bin/ssh user@remote_system1 /sbin/zfs
|
|
|
|
target_zfs_cmd=/sbin/zfs
|
|
|
|
send_enable=all
|
|
|
|
snapshot_interval=1h
|
|
|
|
target_fs=tank/backup/remote_system1
|
|
|
|
recv_flags=-u
|
|
|
|
weed_enable=1
|
|
|
|
keep_hourly=24
|
|
|
|
keep_daily=7
|
|
|
|
keep_weekly=4
|
|
|
|
keep_monthly=4
|