prune.rst.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 WITHIN] [-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 set remote path to executable (default: "borg")
  29. -n, --dry-run do not change repository
  30. --force force pruning of corrupted archives
  31. -s, --stats print statistics for the deleted archive
  32. --list output verbose list of archives it keeps/prunes
  33. --keep-within WITHIN keep all archives within this time interval
  34. -H HOURLY, --keep-hourly HOURLY
  35. number of hourly archives to keep
  36. -d DAILY, --keep-daily DAILY
  37. number of daily archives to keep
  38. -w WEEKLY, --keep-weekly WEEKLY
  39. number of weekly archives to keep
  40. -m MONTHLY, --keep-monthly MONTHLY
  41. number of monthly archives to keep
  42. -y YEARLY, --keep-yearly YEARLY
  43. number of yearly archives to keep
  44. -P PREFIX, --prefix PREFIX
  45. only consider archive names starting with this prefix
  46. --save-space work slower, but using less space
  47. Description
  48. ~~~~~~~~~~~
  49. The prune command prunes a repository by deleting all archives not matching
  50. any of the specified retention options. This command is normally used by
  51. automated backup scripts wanting to keep a certain number of historic backups.
  52. As an example, "-d 7" means to keep the latest backup on each day, up to 7
  53. most recent days with backups (days without backups do not count).
  54. The rules are applied from hourly to yearly, and backups selected by previous
  55. rules do not count towards those of later rules. The time that each backup
  56. starts is used for pruning purposes. Dates and times are interpreted in
  57. the local timezone, and weeks go from Monday to Sunday. Specifying a
  58. negative number of archives to keep means that there is no limit.
  59. The "--keep-within" option takes an argument of the form "<int><char>",
  60. where char is "H", "d", "w", "m", "y". For example, "--keep-within 2d" means
  61. to keep all archives that were created within the past 48 hours.
  62. "1m" is taken to mean "31d". The archives kept with this option do not
  63. count towards the totals specified by any other options.
  64. If a prefix is set with -P, then only archives that start with the prefix are
  65. considered for deletion and only those archives count towards the totals
  66. specified by the rules.
  67. Otherwise, *all* archives in the repository are candidates for deletion!