|
NAMEzfs-snapshot-mgmt —
automate creation of new and removal of stale ZFS
snapshots
SYNOPSIS
DESCRIPTIONThe utility creates ZFS snapshots and removes snapshots it has created that are stale. Rules for creating and removing are defined in the configuration file.
CONFIGURATIONzfs-snapshot-mgmt reads settings from the
/usr/local/etc/zfs-snapshot-mgmt.conf file.
General StructureThe file is in the YAML format: it contains keys and values separated by a colon (:). Each value may span multiple lines and be a list or a map with key-value pairs. The indentation is always a multiple of two spaces.There are two top-level options:
There is an example configuration in the EXAMPLES section. Creation RulesFor each filesystem there is one snapshotcreation_rule
defined. It specifies when snapshots for the particular filesystem should be
created. It has two parameters. All values are specified in minutes.
Preservation RulesThese rules specify which of the created snapshots should be preserved. All that do not match the any of the rules and whose names begin withsnapshot_prefix are destroyed.
Each of the rules has three parameters:
EXAMPLESCrontab ConfigurationTo invoke the program every five minutes you may add the following line to the /etc/crontab configuration file:*/5 * * * * root
/usr/local/bin/zfs-snapshot-mgmt
Bear in mind that this effectively limits the resolution to 5 minutes. zfs-snapshot-mgmt.confHere is an example configuration.snapshot_prefix: auto- filesystems: tank/usr/home: creation_rule: at_multiple: 5 offset: 0 preservation_rules: - { for_minutes: 90, at_multiple: 0, offset: 0 } - { for_minutes: 720, at_multiple: 30, offset: 0 } - { for_minutes: 10080, at_multiple: 180, offset: 120 } tank/usr: recursive: true creation_rule: at_multiple: 1440 offset: 1200 preservation_rules: - { for_minutes: 5760, at_multiple: 1440, offset: 1200 } which specifies the following settings:
FILES/usr/local/etc/zfs-snapshot-mgmt.conf The configuration fileSEE ALSOcron(8), zfs(1M)AUTHORSMarcin Simonides ⟨marcin@studio4plus.com⟩BUGSThere is no way to use alternative path for the configuration file.
Visit the GSP FreeBSD Man Page Interface. |