bdrewery / zfstools

Various ZFS scripts. Most notably, zfs-auto-snapshot, a ruby clone of OpenSolaris auto snapshotting
Other
141 stars 29 forks source link

zfs-auto-snapshot does not destroy old snapshots if -P is used #22

Closed aspoon closed 9 years ago

aspoon commented 10 years ago

Given the pool mypool and dataset mypool/myfs, with auto-snapshot enabled for myfs (implicitly disabled for mypool).

The command line zfs-auto-snapshot -P mypool daily 7 does not destroy snapshots older than 7 days.

Parakleta commented 9 years ago

I've run into this issue too. To fix it you need to pass the object { 'recursive' => true } as the second argument to the Zfs::Snapshot.list() call in zfstools.rb.

bdrewery commented 9 years ago

Thanks, will review soon.

bdrewery commented 9 years ago

This also affected the zfs-cleanup-snapshots script.