prune.rst.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. usage: borg prune [-h] [--critical] [--error] [--warning] [--info] [--debug]
  7. [--lock-wait N] [--show-rc] [--no-files-cache] [--umask M]
  8. [--remote-path PATH] [-n] [--force] [-s] [--list]
  9. [--keep-within INTERVAL] [-H HOURLY] [-d DAILY] [-w WEEKLY]
  10. [-m MONTHLY] [-y YEARLY] [-P PREFIX] [--save-space]
  11. [REPOSITORY]
  12. Prune repository archives according to specified rules
  13. positional arguments:
  14. REPOSITORY repository to prune
  15. optional arguments:
  16. -h, --help show this help message and exit
  17. --critical work on log level CRITICAL
  18. --error work on log level ERROR
  19. --warning work on log level WARNING (default)
  20. --info, -v, --verbose
  21. work on log level INFO
  22. --debug work on log level DEBUG
  23. --lock-wait N wait for the lock, but max. N seconds (default: 1).
  24. --show-rc show/log the return code (rc)
  25. --no-files-cache do not load/update the file metadata cache used to
  26. detect unchanged files
  27. --umask M set umask to M (local and remote, default: 0077)
  28. --remote-path PATH use PATH as borg executable on the remote (default:
  29. "borg")
  30. -n, --dry-run do not change repository
  31. --force force pruning of corrupted archives
  32. -s, --stats print statistics for the deleted archive. Requires
  33. -v/--verbose.
  34. --list output verbose list of archives it keeps/prunes.
  35. Requires -v/--verbose.
  36. --keep-within INTERVAL
  37. keep all archives within this time interval
  38. -H HOURLY, --keep-hourly HOURLY
  39. number of hourly archives to keep
  40. -d DAILY, --keep-daily DAILY
  41. number of daily archives to keep
  42. -w WEEKLY, --keep-weekly WEEKLY
  43. number of weekly archives to keep
  44. -m MONTHLY, --keep-monthly MONTHLY
  45. number of monthly archives to keep
  46. -y YEARLY, --keep-yearly YEARLY
  47. number of yearly archives to keep
  48. -P PREFIX, --prefix PREFIX
  49. only consider archive names starting with this prefix
  50. --save-space work slower, but using less space
  51. Description
  52. ~~~~~~~~~~~
  53. The prune command prunes a repository by deleting all archives not matching
  54. any of the specified retention options. This command is normally used by
  55. automated backup scripts wanting to keep a certain number of historic backups.
  56. As an example, "-d 7" means to keep the latest backup on each day, up to 7
  57. most recent days with backups (days without backups do not count).
  58. The rules are applied from hourly to yearly, and backups selected by previous
  59. rules do not count towards those of later rules. The time that each backup
  60. starts is used for pruning purposes. Dates and times are interpreted in
  61. the local timezone, and weeks go from Monday to Sunday. Specifying a
  62. negative number of archives to keep means that there is no limit.
  63. The "--keep-within" option takes an argument of the form "<int><char>",
  64. where char is "H", "d", "w", "m", "y". For example, "--keep-within 2d" means
  65. to keep all archives that were created within the past 48 hours.
  66. "1m" is taken to mean "31d". The archives kept with this option do not
  67. count towards the totals specified by any other options.
  68. If a prefix is set with -P, then only archives that start with the prefix are
  69. considered for deletion and only those archives count towards the totals
  70. specified by the rules.
  71. Otherwise, *all* archives in the repository are candidates for deletion!
  72. There is no automatic distinction between archives representing different
  73. contents. These need to be distinguished by specifying matching prefixes.