snapshotter
snapshotter copied to clipboard
Don't get into a --max-snapshots infinite loop
When --max-snapshots
is used and _remove_oldest_snapshot()
doesn't actually reduce the number of snapshots reported to _ls_snapshots()
(for example when --dry-run
is used so that we don't actually run the rm
command) then snapshotter gets into an infinite loop as it keeps calling _remove_oldest_snapshot()
until _ls_snapshots()
reports less than --max-snapshots
snapshots, but _ls_snapshots()
always reports the same number.