ZFS automatic snapshots utility

Hello, I have installed the automatic snapshot utility from /usr/ports/sysutils/zfs-snapshot-mgmt. This utility uses the zfs-snapshot-mgmt.conf file as its configuration and here are the contents of mine:

Code:
# Automatic ZFS snapshot management configuration file
#
# This is a YAML file (see http://www.yaml.org)
# Use exactly 2 spaces for each indentation level
#
snapshot_prefix: auto-
filesystems:
  tank/data/user:
    # Create snapshots every 24 hours, starting at 20:00.
    creation_rule:
      at_multiple: 1440
      offset: 1300
    # Keep daily snapshots created at 20:00 (in this case all).
    preservation_rules:
      - { for_minutes: 20160, at_multiple: 1440, offset: 1200 }

When I run /usr/local/bin/zfs-snapshot-mgmt from cron nothing happens, no snapshots are created. When I manually run it no error message is reported but no snapshot is ceated either.

Any help is appreciated.
 
Can you try it with # zfs set snapdir=visible <fs>?
 
#zfs list
Should show any snapshots made, definitely including the ones that were made via that utility. If you're not seeing them there, then they weren't made.
 
This is my working configuration:

Code:
# Automatic ZFS snapshot management configuration file
#
# This is a YAML file (see http://www.yaml.org)
# Use exactly 2 spaces for each indentation level
#
snapshot_prefix: auto-
filesystems:
  tank/home:
    # Create snapshots recursively for all filesystems mounted under this one
    recursive: true
    # Create snapshots every 10 minutes, starting at midnight
    creation_rule:
      at_multiple: 10
      offset: 0
    # Keep all snapshots for the first 90 minutes,
    # then only those that were created at 30 minute intervals for 12 hours
    # (after snapshot creation),
    # then only those that were created at 3 hour intervals, counting at 2:00
    # (i.e. 2:00, 5:00, 8:00, 11:00, 14:00, 17:00, 20:00, 23:00)
    # for 7 days
    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 }
 
I copied your config and it still didn't work - no error message but no snapshot either.

I used truss to see what the program was doing when I ran it and I have attached the output to this message (see attached .zip file, lots of data). Suffice it to say there are messages like this:

Code:
stat("/usr/local/lib/ruby/site_ruby/1.8/i386-freebsd7/date/format.rb",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/site_ruby/1.8/i386-freebsd7/date/format.so",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/site_ruby/date/format.rb",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/site_ruby/date/format.so",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/1.8/date/format.rb",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/1.8/date/format.so",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/1.8/i386-freebsd7/date/format.rb",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/1.8/i386-freebsd7/date/format.so",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/date/format.rb",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/vendor_ruby/date/format.so",0xbfbfdb6c) ERR#2 'No such file or directory'
stat("/usr/local/lib/ruby/1.8/date/format.rb

but it does seem to access the snapshot directory:

Code:
open("/data/user/.zfs/snapshot",O_NONBLOCK,05001176626) = 7 (0x7)
fstat(7,{ mode=dr-xr-xr-x ,inode=2,size=2,blksize=4096 }) = 0 (0x0)
 

Attachments

Back
Top