When running zfs-auto-snapshot:
$ sudo /usr/local/sbin/zfs-auto-snapshot weekly 4
/usr/local/lib/ruby/site_ruby/2.1/zfstools/snapshot.rb:118:in `/': divided by 0 (ZeroDivisionError)
from /usr/local/lib/ruby/site_ruby/2.1/zfstools/snapshot.rb:118:in `create_many'
from /usr/local/lib/ruby/site_ruby/2.1/zfstools.rb:152:in `do_new_snapshots'
from /usr/local/sbin/zfs-auto-snapshot:68:in `<main>'
Initially I thought that this was because I was running it on a test system, however I also tried creating some snapshots ("zfs snapshot -r zroot@zfs-auto-snap_weekly-2015-09-13-00h00") and "zfs-auto-snapshot weekly 4" still failed with the above error.
Thanks. I ran into it as well during development but thought it may be limited to test code I had. Will have it fixed soon.
A commit references this bug:
Date: Tue Sep 15 15:56:17 UTC 2015
New revision: 396993
- Update to 0.3.5
- Optimize coalescing of snapshots on a system with a DB.
- Avoid division by zero when creating snapshots.