zfsa-policy-create(1)

Make a snapshot policy

ZFS Assistant 0.7.0

NAME

zfsa-policy-create - Make a snapshot policy

SYNOPSIS

zfsa policy create [GLOBAL OPTIONS] [--keep] [--every] [--exclude] [--keep-interval] [--keep-hourly] [--keep-daily] [--keep-weekly] [--keep-monthly] [--keep-yearly] [--received] [-h|--help] <NAME> <DATASETS>

DESCRIPTION

Make a snapshot policy.

A policy takes snapshots of its datasets and the datasets inside them, including ones made later, and prunes the ones it no longer keeps. The month template keeps 4 snapshots at the interval, 24 hourly, 7 daily and 4 weekly; the --keep-* options change single counts. Pruning never deletes the newest snapshot, held snapshots, clone origins or the base a backup still needs, and never touches snapshots taken by hand. Use zfsa policy preview to see what a policy keeps.

OPTIONS

--keep <KEEP>

How far back to go: week, month (the default) or year

Possible values:

  • week: A week

  • month: A month

  • year: A year

--every <INTERVAL>

How often to take a snapshot, such as 15m or 1h (every 15 minutes by default)

--exclude <DATASET>

A dataset to leave out. Repeat for more

--keep-interval <N>

Snapshots at the policy's own interval to keep

--keep-hourly <N>

Hourly snapshots to keep

--keep-daily <N>

Daily snapshots to keep

--keep-weekly <N>

Weekly snapshots to keep

--keep-monthly <N>

Monthly snapshots to keep

--keep-yearly <N>

Yearly snapshots to keep

--received

Take no snapshots. Only prune snapshots received from other machines

-h, --help

Print help (see a summary with '-h')

<NAME>

The policy's name

<DATASETS>

The datasets it covers (with the datasets inside them)

EXAMPLES

Snapshots of tank/photos and everything inside it every 15 minutes, kept for a month:

zfsa policy create photos tank/photos

Hourly snapshots of the home datasets kept for a year, leaving out a cache:

zfsa policy create home rpool/home --every 1h --keep year --exclude rpool/home/cache

On a backup server, prune the snapshots that arrive from other computers:

zfsa policy create received backup --received --keep-daily 30 --keep-monthly 12

SEE ALSO

zfsa(1) for the global options, authorization, confirmations and exit status, zfsa-policy(1).