analyze.rst.inc 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_analyze:
  3. borg analyze
  4. ------------
  5. .. code-block:: none
  6. borg [common options] analyze [options]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  10. | .. class:: borg-common-opt-ref |
  11. | |
  12. | :ref:`common_options` |
  13. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  14. | **Archive filters** — Archive filters can be applied to repository targets. |
  15. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  16. | | ``-a PATTERN``, ``--match-archives PATTERN`` | only consider archives matching all patterns. see "borg help match-archives". |
  17. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp |
  19. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  20. | | ``--first N`` | consider first N archives after other filters were applied |
  21. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--last N`` | consider last N archives after other filters were applied |
  23. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  24. | | ``--oldest TIMESPAN`` | consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m. |
  25. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  26. | | ``--newest TIMESPAN`` | consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m. |
  27. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  28. | | ``--older TIMESPAN`` | consider archives older than (now - TIMESPAN), e.g. 7d or 12m. |
  29. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  30. | | ``--newer TIMESPAN`` | consider archives newer than (now - TIMESPAN), e.g. 7d or 12m. |
  31. +-----------------------------------------------------------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  32. .. raw:: html
  33. <script type='text/javascript'>
  34. $(document).ready(function () {
  35. $('.borg-options-table colgroup').remove();
  36. })
  37. </script>
  38. .. only:: latex
  39. :ref:`common_options`
  40. |
  41. Archive filters
  42. -a PATTERN, --match-archives PATTERN only consider archives matching all patterns. see "borg help match-archives".
  43. --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
  44. --first N consider first N archives after other filters were applied
  45. --last N consider last N archives after other filters were applied
  46. --oldest TIMESPAN consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  47. --newest TIMESPAN consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m.
  48. --older TIMESPAN consider archives older than (now - TIMESPAN), e.g. 7d or 12m.
  49. --newer TIMESPAN consider archives newer than (now - TIMESPAN), e.g. 7d or 12m.
  50. Description
  51. ~~~~~~~~~~~
  52. Analyze archives to find "hot spots".
  53. Borg analyze relies on the usual archive matching options to select the
  54. archives that should be considered for analysis (e.g. ``-a series_name``).
  55. Then it iterates over all matching archives, over all contained files and
  56. collects information about chunks stored in all directories it encountered.
  57. It considers chunk IDs and their plaintext sizes (we don't have the compressed
  58. size in the repository easily available) and adds up added/removed chunks'
  59. sizes per direct parent directory and outputs a list of "directory: size".
  60. You can use that list to find directories with a lot of "activity" - maybe
  61. some of these are temporary or cache directories you did forget to exclude.
  62. To not have these unwanted directories in your backups, you could carefully
  63. exclude these in ``borg create`` (for future backups) or use ``borg recreate``
  64. to re-create existing archives without these.