0

zfs-auto-snapshot is installed and has had the following settings applied to it:

# zfs get all backup
NAME    PROPERTY                        VALUE                           SOURCE
backup  com.sun:auto-snapshot           true                            local
backup  com.sun:auto-snapshot:monthly   true                            local
backup  com.sun:auto-snapshot:weekly    true                            local
backup  com.sun:auto-snapshot:hourly    true                            local
backup  com.sun:auto-snapshot:frequent  true                            local
backup  com.sun:auto-snapshot:daily     true                            local

It's been half a week since it's been installed and when the snapshots are inspected, only the four most frequent snapshots exist:

# zfs list -t snapshot
NAME                                            USED  AVAIL  REFER  MOUNTPOINT
backup@zfs-auto-snap_frequent-2017-06-17-0645  3.06M      -   123G  -
backup@zfs-auto-snap_frequent-2017-06-17-0700  1.57M      -   123G  -
backup@zfs-auto-snap_frequent-2017-06-17-0715  1.43M      -   123G  -
backup@zfs-auto-snap_frequent-2017-06-17-0730   928K      -   123G  -
2

You should read the documentation or source code.

Open /sbin/zfs-auto-snapshot and set your system default options.

# Set default program options.
opt_backup_full=''
opt_backup_incremental=''
opt_default_exclude='1'
opt_dry_run=''
opt_event='-'
opt_fast_zfs_list='1'
opt_keep=''
opt_label=''
opt_prefix='snap'
opt_recursive=''
opt_sep='_'
opt_setauto=''
opt_syslog=''
opt_skip_scrub=''
opt_verbose=''
opt_pre_snapshot=''
opt_post_snapshot=''
opt_do_snapshots='1'

The cron script in /etc/cron.d/zfs-auto-snapshot runs the command with the appropriate parameters:

PATH="/usr/bin:/bin:/usr/sbin:/sbin"

*/5 * * * * root /sbin/zfs-auto-snapshot -q -g --label=frequent --keep=24 //
00 * * * * root /sbin/zfs-auto-snapshot -q -g --label=hourly --keep=24 //
59 23 * * * root /sbin/zfs-auto-snapshot -q -g --label=daily --keep=14 //
59 23 * * 0 root /sbin/zfs-auto-snapshot -q -g --label=weekly --keep=4 //
00 00 1 * * root /sbin/zfs-auto-snapshot -q -g --label=monthly --keep=4 //

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.