With snapper you can set --userdata important=yes when creating a snapshot which will make automatic cleanups more conservative by merit of supposedly being fewer and being counted separately. By default:
NUMBER_LIMIT="50"
NUMBER_LIMIT_IMPORTANT="10"
meaning that for snapshots marked for the "number" cleanup algorithm, it will keep the last 50 normal snapshots and the last 10 important snapshots. So even if the 10th oldest important snapshot is older than the 50th oldest snapshot, it gets preserved.
On openSUSE, zypper transactions are marked important, but snapper-boot.timer snapshots and YaST commands (which create pre-post snapshots) are not. It would seem prudent to mimic them in this, and mark DNF snapshots important. Even if we don't have YaST, we do have snapper-boot.timer and we do have snapper create --command which can wrap any command in a pre-post snapshot. It would be useful for DNF upgrades to be preserved more conservatively than those uses.
I'm not clear on what happens to "important" snapshots that are older than NUMBER_LIMIT_IMPORTANT but younger than NUMBER_LIMIT; do they get deleted before unimportant snapshots or do they get demoted to unimportant and kept until that limit is reached? Either way the idea seems to be that important snapshots are much rarer, and so take longer to reach the limits. That's understandable on openSUSE which wraps every YaST command in a pre-post snapshot, but it's less likely to be the case on a Fedora system unless you use snapper create --cleanup-algorithm number --command {cmd} liberally. But only by marking DNF snapshots important do we enable this use case, so it could be worth it. You can also adjust NUMBER_LIMIT_IMPORTANT if you find that only keeping 10 as opposed to 50 DNF snapshots isn't enough for you. The main point is that they're kept up to that limit regardless of how many other "number" snapshots you create for other purposes.
With snapper you can set
--userdata important=yeswhen creating a snapshot which will make automatic cleanups more conservative by merit of supposedly being fewer and being counted separately. By default:meaning that for snapshots marked for the "number" cleanup algorithm, it will keep the last 50 normal snapshots and the last 10 important snapshots. So even if the 10th oldest important snapshot is older than the 50th oldest snapshot, it gets preserved.
On openSUSE,
zyppertransactions are marked important, butsnapper-boot.timersnapshots and YaST commands (which create pre-post snapshots) are not. It would seem prudent to mimic them in this, and mark DNF snapshots important. Even if we don't have YaST, we do havesnapper-boot.timerand we do havesnapper create --commandwhich can wrap any command in a pre-post snapshot. It would be useful for DNF upgrades to be preserved more conservatively than those uses.I'm not clear on what happens to "important" snapshots that are older than
NUMBER_LIMIT_IMPORTANTbut younger thanNUMBER_LIMIT; do they get deleted before unimportant snapshots or do they get demoted to unimportant and kept until that limit is reached? Either way the idea seems to be that important snapshots are much rarer, and so take longer to reach the limits. That's understandable on openSUSE which wraps every YaST command in a pre-post snapshot, but it's less likely to be the case on a Fedora system unless you usesnapper create --cleanup-algorithm number --command {cmd}liberally. But only by marking DNF snapshots important do we enable this use case, so it could be worth it. You can also adjustNUMBER_LIMIT_IMPORTANTif you find that only keeping 10 as opposed to 50 DNF snapshots isn't enough for you. The main point is that they're kept up to that limit regardless of how many other "number" snapshots you create for other purposes.