Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use native zfs functionality for protecting snaps with clones

  • Loading branch information...
commit be570410aa6e57b10b46af0e5078af216a4377d9 1 parent 00c145c
@noprobs noprobs authored
Showing with 1 addition and 11 deletions.
  1. +1 −11 gui/tools/autosnap.py
View
12 gui/tools/autosnap.py
@@ -192,16 +192,6 @@ def exit_if_running(pid):
else:
snapshots[(fs, snap_ret_policy)] = snap_infodict
-# Exclude snapshots that have clones associated from being deleted
-if len(snapshots_pending_delete) > 0:
- snapshots_cloned = set()
- zfsproc = pipeopen("/sbin/zfs list -H -t filesystem,volume -o origin", debug, logger=log)
- lines = zfsproc.communicate()[0].split('\n')
- for snapshot_name in lines:
- if snapshot_name != '-':
- snapshots_cloned.add(snapshot_name)
- snapshots_pending_delete = snapshots_pending_delete.difference(snapshots_cloned)
-
list_mp = mp_to_task_map.keys()
for mpkey in list_mp:
@@ -253,7 +243,7 @@ def exit_if_running(pid):
if output != '':
fsname, attrname, value, source = output.split('\n')[0].split('\t')
if value == '-':
- snapcmd = '/sbin/zfs destroy -r %s' % (snapshot)
+ snapcmd = '/sbin/zfs destroy -r -d %s' % (snapshot) #snapshots with clones will have destruction deferred
proc = pipeopen(snapcmd, logger=log)
err = proc.communicate()[1]
if proc.returncode != 0:
Please sign in to comment.
Something went wrong with that request. Please try again.