- snapshotdir="${mountpoint}/.zfs/snapshot"
-fi
-
-if [ ! -d "$snapshotdir" ]; then
- echo "-E- Unable to find the snapshotdir: $snapshotdir"
- exit 1
+ snapshots=$(zfs list -H -t snapshot -o name $filesystem | grep -P "\d+-\d+\.\d+\.\d+")
fi
# Check to see if this zfs filesystem has a scrub being performed on it now.
# If it does, we cannot perform any snapshot create or destroy operations.
if [ -z "$SNAP_UNDER_TEST" ]; then
fi
# Check to see if this zfs filesystem has a scrub being performed on it now.
# If it does, we cannot perform any snapshot create or destroy operations.
if [ -z "$SNAP_UNDER_TEST" ]; then
for snapshot in $snapshots; do
snapminutes=$(echo "$snapshot" | sed 's,.*/,,' | datetime_to_minutes)
snapminutes2=$(echo "$snapshot" | sed 's,.*/,,' | datetime_to_minutes2)
for snapshot in $snapshots; do
snapminutes=$(echo "$snapshot" | sed 's,.*/,,' | datetime_to_minutes)
snapminutes2=$(echo "$snapshot" | sed 's,.*/,,' | datetime_to_minutes2)
- *)
- snapname=${filesystem}$(echo "$snapshot" |
- sed 's,/\(.*\)/.zfs/snapshot/\(.*\),@\2,')
- destroy "$snapname"
- ;;
+ *) destroy "$snapshot" ;;