prune.rst.inc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_prune:
  3. borg prune
  4. ----------
  5. ::
  6. borg prune <options> REPOSITORY
  7. positional arguments
  8. REPOSITORY
  9. repository to prune
  10. optional arguments
  11. ``-n``, ``--dry-run``
  12. | do not change repository
  13. ``--force``
  14. | force pruning of corrupted archives
  15. ``-p``, ``--progress``
  16. | show progress display while deleting archives
  17. ``-s``, ``--stats``
  18. | print statistics for the deleted archive
  19. ``--list``
  20. | output verbose list of archives it keeps/prunes
  21. ``--keep-within WITHIN``
  22. | keep all archives within this time interval
  23. ``--keep-last``, ``--keep-secondly``
  24. | number of secondly archives to keep
  25. ``--keep-minutely``
  26. | number of minutely archives to keep
  27. ``-H``, ``--keep-hourly``
  28. | number of hourly archives to keep
  29. ``-d``, ``--keep-daily``
  30. | number of daily archives to keep
  31. ``-w``, ``--keep-weekly``
  32. | number of weekly archives to keep
  33. ``-m``, ``--keep-monthly``
  34. | number of monthly archives to keep
  35. ``-y``, ``--keep-yearly``
  36. | number of yearly archives to keep
  37. ``-P``, ``--prefix``
  38. | only consider archive names starting with this prefix
  39. ``--save-space``
  40. | work slower, but using less space
  41. `Common options`_
  42. |
  43. Description
  44. ~~~~~~~~~~~
  45. The prune command prunes a repository by deleting all archives not matching
  46. any of the specified retention options. This command is normally used by
  47. automated backup scripts wanting to keep a certain number of historic backups.
  48. Also, prune automatically removes checkpoint archives (incomplete archives left
  49. behind by interrupted backup runs) except if the checkpoint is the latest
  50. archive (and thus still needed). Checkpoint archives are not considered when
  51. comparing archive counts against the retention limits (--keep-X).
  52. If a prefix is set with -P, then only archives that start with the prefix are
  53. considered for deletion and only those archives count towards the totals
  54. specified by the rules.
  55. Otherwise, *all* archives in the repository are candidates for deletion!
  56. There is no automatic distinction between archives representing different
  57. contents. These need to be distinguished by specifying matching prefixes.
  58. If you have multiple sequences of archives with different data sets (e.g.
  59. from different machines) in one shared repository, use one prune call per
  60. data set that matches only the respective archives using the -P option.
  61. The "--keep-within" option takes an argument of the form "<int><char>",
  62. where char is "H", "d", "w", "m", "y". For example, "--keep-within 2d" means
  63. to keep all archives that were created within the past 48 hours.
  64. "1m" is taken to mean "31d". The archives kept with this option do not
  65. count towards the totals specified by any other options.
  66. A good procedure is to thin out more and more the older your backups get.
  67. As an example, "--keep-daily 7" means to keep the latest backup on each day,
  68. up to 7 most recent days with backups (days without backups do not count).
  69. The rules are applied from secondly to yearly, and backups selected by previous
  70. rules do not count towards those of later rules. The time that each backup
  71. starts is used for pruning purposes. Dates and times are interpreted in
  72. the local timezone, and weeks go from Monday to Sunday. Specifying a
  73. negative number of archives to keep means that there is no limit.
  74. The "--keep-last N" option is doing the same as "--keep-secondly N" (and it will
  75. keep the last N archives under the assumption that you do not create more than one
  76. backup archive in the same second).