1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-30 00:00:14 +01:00

prune: allow --repack-smaller-than independently of --repack-small

This commit is contained in:
Michael Eischer 2025-03-22 15:08:36 +01:00
parent 3f42c0ad96
commit 3e58b15ace
3 changed files with 4 additions and 11 deletions

View file

@ -1,8 +1,7 @@
Enhancement: Make small pack size configureable for `prune`
The `prune` command now supports the `--repack-smaller-than` option that
allows repacking pack files smaller than the given size. It has to be used in
conjunction with option `--repack-small`.
allows repacking pack files smaller than the given size.
https://github.com/restic/restic/issues/5109
https://github.com/restic/restic/pull/5183

View file

@ -143,11 +143,6 @@ func verifyPruneOptions(opts *PruneOptions) error {
}
}
if !opts.RepackSmall && opts.SmallPackSize != "" {
return errors.Fatal("option --repack-small and --repack-smaller-than: must be specified together")
}
opts.SmallPackBytes = uint64(0)
if opts.SmallPackSize != "" {
size, err := ui.ParseBytes(opts.SmallPackSize)
if err != nil {

View file

@ -466,10 +466,9 @@ The ``prune`` command accepts the following options:
- ``--repack-small`` if set will repack pack files below 80% of target pack size.
The default value is false.
- ``--repack-smaller-than`` in conjunction with ``--repack-small`` will repack all
packfiles below the size of ``--repack-smaller-than``. This will allow to repack
packfiles which initially came from a repository with a smaller ``--pack-size``
to be compacted into larger packfiles.
- ``--repack-smaller-than`` will repack all packfiles below the size of
``--repack-smaller-than``. This allows repacking packfiles that initially came from a
repository with a smaller ``--pack-size`` to be compacted into larger packfiles.
- ``--dry-run`` only show what ``prune`` would do.