list.rst.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_list:
  3. borg list
  4. ---------
  5. .. code-block:: none
  6. borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to list contents of |
  13. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | | ``PATH`` | paths to list; patterns are supported |
  15. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | **optional arguments** |
  17. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--short`` | only print file/directory names, nothing else |
  19. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``--format FORMAT``, ``--list-format FORMAT`` | specify format for file or archive listing (default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives: "{archive:<36} {time} [{id}]{NL}") |
  21. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--json`` | Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available. |
  23. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | | ``--json-lines`` | Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available. |
  25. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | .. class:: borg-common-opt-ref |
  27. | |
  28. | :ref:`common_options` |
  29. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | **Archive filters** — Archive filters can be applied to repository targets. |
  31. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. |
  33. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. |
  35. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp |
  37. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--first N`` | consider first N archives after other filters were applied |
  39. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | | ``--last N`` | consider last N archives after other filters were applied |
  41. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | **Exclusion options** |
  43. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  45. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  47. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
  49. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
  51. +-----------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. .. raw:: html
  53. <script type='text/javascript'>
  54. $(document).ready(function () {
  55. $('.borg-options-table colgroup').remove();
  56. })
  57. </script>
  58. .. only:: latex
  59. REPOSITORY_OR_ARCHIVE
  60. repository or archive to list contents of
  61. PATH
  62. paths to list; patterns are supported
  63. optional arguments
  64. --short only print file/directory names, nothing else
  65. --format FORMAT, --list-format FORMAT specify format for file or archive listing (default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives: "{archive:<36} {time} [{id}]{NL}")
  66. --json Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available.
  67. --json-lines Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available.
  68. :ref:`common_options`
  69. |
  70. Archive filters
  71. -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix.
  72. -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive.
  73. --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
  74. --first N consider first N archives after other filters were applied
  75. --last N consider last N archives after other filters were applied
  76. Exclusion options
  77. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  78. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  79. --pattern PATTERN include/exclude paths matching PATTERN
  80. --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
  81. Description
  82. ~~~~~~~~~~~
  83. This command lists the contents of a repository or an archive.
  84. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output.
  85. .. man NOTES
  86. The FORMAT specifier syntax
  87. +++++++++++++++++++++++++++
  88. The ``--format`` option uses python's `format string syntax
  89. <https://docs.python.org/3.8/library/string.html#formatstrings>`_.
  90. Examples:
  91. ::
  92. $ borg list --format '{archive}{NL}' /path/to/repo
  93. ArchiveFoo
  94. ArchiveBar
  95. ...
  96. # {VAR:NUMBER} - pad to NUMBER columns.
  97. # Strings are left-aligned, numbers are right-aligned.
  98. # Note: time columns except ``isomtime``, ``isoctime`` and ``isoatime`` cannot be padded.
  99. $ borg list --format '{archive:36} {time} [{id}]{NL}' /path/to/repo
  100. ArchiveFoo Thu, 2021-12-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274]
  101. $ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo
  102. -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
  103. ...
  104. # {VAR:<NUMBER} - pad to NUMBER columns left-aligned.
  105. # {VAR:>NUMBER} - pad to NUMBER columns right-aligned.
  106. $ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo
  107. -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
  108. ...
  109. The following keys are always available:
  110. - NEWLINE: OS dependent line separator
  111. - NL: alias of NEWLINE
  112. - NUL: NUL character for creating print0 / xargs -0 like output, see barchive and bpath keys below
  113. - SPACE
  114. - TAB
  115. - CR
  116. - LF
  117. Keys available only when listing archives in a repository:
  118. - archive: archive name interpreted as text (might be missing non-text characters, see barchive)
  119. - name: alias of "archive"
  120. - barchive: verbatim archive name, can contain any character except NUL
  121. - comment: archive comment interpreted as text (might be missing non-text characters, see bcomment)
  122. - bcomment: verbatim archive comment, can contain any character except NUL
  123. - id: internal ID of the archive
  124. - start: time (start) of creation of the archive
  125. - time: alias of "start"
  126. - end: time (end) of creation of the archive
  127. - command_line: command line which was used to create the archive
  128. - hostname: hostname of host on which this archive was created
  129. - username: username of user who created this archive
  130. Keys available only when listing files in an archive:
  131. - type
  132. - mode
  133. - uid
  134. - gid
  135. - user
  136. - group
  137. - path: path interpreted as text (might be missing non-text characters, see bpath)
  138. - bpath: verbatim POSIX path, can contain any character except NUL
  139. - source: link target for links (identical to linktarget)
  140. - linktarget
  141. - flags
  142. - size
  143. - csize: compressed size
  144. - dsize: deduplicated size
  145. - dcsize: deduplicated compressed size
  146. - num_chunks: number of chunks in this file
  147. - unique_chunks: number of unique chunks in this file
  148. - mtime
  149. - ctime
  150. - atime
  151. - isomtime
  152. - isoctime
  153. - isoatime
  154. - blake2b
  155. - blake2s
  156. - md5
  157. - sha1
  158. - sha224
  159. - sha256
  160. - sha384
  161. - sha3_224
  162. - sha3_256
  163. - sha3_384
  164. - sha3_512
  165. - sha512
  166. - archiveid
  167. - archivename
  168. - extra: prepends {source} with " -> " for soft links and " link to " for hard links
  169. - health: either "healthy" (file ok) or "broken" (if file has all-zero replacement chunks)