mirror of
https://github.com/restic/restic.git
synced 2025-08-21 19:37:46 +00:00
prune: allow --repack-smaller-than independently of --repack-small
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
Enhancement: Make small pack size configureable for `prune`
|
Enhancement: Make small pack size configureable for `prune`
|
||||||
|
|
||||||
The `prune` command now supports the `--repack-smaller-than` option that
|
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
|
allows repacking pack files smaller than the given size.
|
||||||
conjunction with option `--repack-small`.
|
|
||||||
|
|
||||||
https://github.com/restic/restic/issues/5109
|
https://github.com/restic/restic/issues/5109
|
||||||
https://github.com/restic/restic/pull/5183
|
https://github.com/restic/restic/pull/5183
|
||||||
|
@@ -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 != "" {
|
if opts.SmallPackSize != "" {
|
||||||
size, err := ui.ParseBytes(opts.SmallPackSize)
|
size, err := ui.ParseBytes(opts.SmallPackSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -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.
|
- ``--repack-small`` if set will repack pack files below 80% of target pack size.
|
||||||
The default value is false.
|
The default value is false.
|
||||||
|
|
||||||
- ``--repack-smaller-than`` in conjunction with ``--repack-small`` will repack all
|
- ``--repack-smaller-than`` will repack all packfiles below the size of
|
||||||
packfiles below the size of ``--repack-smaller-than``. This will allow to repack
|
``--repack-smaller-than``. This allows repacking packfiles that initially came from a
|
||||||
packfiles which initially came from a repository with a smaller ``--pack-size``
|
repository with a smaller ``--pack-size`` to be compacted into larger packfiles.
|
||||||
to be compacted into larger packfiles.
|
|
||||||
|
|
||||||
- ``--dry-run`` only show what ``prune`` would do.
|
- ``--dry-run`` only show what ``prune`` would do.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user