Skip to content

Commit

Permalink
only remove old snapshots after making one
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiorgy committed Aug 24, 2024
1 parent df4e0a5 commit fdc4e42
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/zfs-auto-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,13 @@ do_snapshots () # properties, flags, snapname, oldglob, [targets...]
WARNING_COUNT=$(( $WARNING_COUNT + 1 ))
continue
fi
fi

# Retain at most $opt_keep number of old snapshots of this filesystem,
# including the one that was just recently created.
test -z "$opt_keep" && continue
KEEP="$opt_keep"
# Retain at most $opt_keep number of old snapshots of this filesystem,
# including the one that was just recently created.
test -z "$opt_keep" && continue
KEEP="$opt_keep"

# ASSERT: The old snapshot list is sorted by increasing age.
if [ "$size_check_skip" -eq 0 ]; then # if skip creating snapshots, then skip deleting old ones also
# ASSERT: The old snapshot list is sorted by increasing age.
for jj in $SNAPSHOTS_OLD
do
# Check whether this is an old snapshot of the filesystem.
Expand Down

0 comments on commit fdc4e42

Please sign in to comment.