borgbackup/docs/usage/list.rst.inc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

159 lines
12 KiB
PHP
Raw Normal View History

2016-07-05 17:30:08 -04:00
.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_list:
borg list
---------
.. code-block:: none
2022-06-23 19:19:19 -04:00
borg [common options] list [options] NAME [PATH...]
2017-06-20 09:22:24 -04:00
.. only:: html
.. class:: borg-options-table
2023-01-02 17:50:50 -05:00
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``NAME`` | specify the archive name |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to list; patterns are supported |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-04-21 15:07:46 -04:00
| **options** |
2023-01-02 17:50:50 -05:00
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--short`` | only print file/directory names, nothing else |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--format FORMAT`` | specify format for file listing (default: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}") |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--json-lines`` | 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. |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--depth N`` | only list files up to the specified directory depth |
2025-05-19 17:20:38 -04:00
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2023-01-02 17:50:50 -05:00
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2023-06-11 17:09:20 -04:00
| **Include/Exclude options** |
2023-01-02 17:50:50 -05:00
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2017-06-20 09:22:24 -04:00
.. raw:: html
<script type='text/javascript'>
$(document).ready(function () {
2017-06-20 09:22:24 -04:00
$('.borg-options-table colgroup').remove();
})
</script>
.. only:: latex
2022-06-23 19:19:19 -04:00
NAME
specify the archive name
2017-06-20 09:22:24 -04:00
PATH
paths to list; patterns are supported
2025-04-21 15:07:46 -04:00
options
2017-06-20 09:22:24 -04:00
--short only print file/directory names, nothing else
2022-06-23 19:19:19 -04:00
--format FORMAT specify format for file listing (default: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}")
2023-01-02 17:50:50 -05:00
--json-lines 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.
2025-12-23 12:00:09 -05:00
--depth N only list files up to the specified directory depth
2017-06-20 09:22:24 -04:00
:ref:`common_options`
|
2023-06-11 17:09:20 -04:00
Include/Exclude options
2017-06-20 09:22:24 -04:00
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
2022-02-05 11:22:33 -05:00
--pattern PATTERN include/exclude paths matching PATTERN
--patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
2017-06-20 05:49:26 -04:00
2017-03-26 19:45:45 -04:00
Description
~~~~~~~~~~~
2022-06-23 19:19:19 -04:00
This command lists the contents of an archive.
2016-03-18 07:17:57 -04:00
2025-12-23 12:00:09 -05:00
For more help on include/exclude patterns, see the output of :ref:`borg_patterns`.
2016-03-18 07:17:57 -04:00
2017-03-26 19:45:45 -04:00
.. man NOTES
2022-01-23 09:52:21 -05:00
The FORMAT specifier syntax
+++++++++++++++++++++++++++
2025-12-23 12:00:09 -05:00
The ``--format`` option uses Python's `format string syntax
2026-06-16 08:17:43 -04:00
<https://docs.python.org/3.11/library/string.html#formatstrings>`_.
2022-01-23 09:52:21 -05:00
Examples:
::
2022-06-23 19:19:19 -04:00
$ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' ArchiveFoo
2022-01-23 09:52:21 -05:00
-rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
...
# {VAR:<NUMBER} - pad to NUMBER columns left-aligned.
# {VAR:>NUMBER} - pad to NUMBER columns right-aligned.
2022-06-23 19:19:19 -04:00
$ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' ArchiveFoo
2022-01-23 09:52:21 -05:00
-rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
...
The following keys are always available:
2017-06-17 20:10:10 -04:00
- NEWLINE: OS dependent line separator
- NL: alias of NEWLINE
2023-01-02 17:50:50 -05:00
- NUL: NUL character for creating print0 / xargs -0 like output
2023-06-11 17:09:20 -04:00
- SPACE: space character
- TAB: tab character
- CR: carriage return character
- LF: line feed character
2022-01-23 09:52:21 -05:00
Keys available only when listing files in an archive:
2023-06-11 17:09:20 -04:00
- type: file type (file, dir, symlink, ...)
- mode: file mode (as in stat)
- uid: user id of file owner
- gid: group id of file owner
- user: user name of file owner
- group: group name of file owner
2023-01-02 17:50:50 -05:00
- path: file path
2023-02-26 15:30:28 -05:00
- target: link target for symlinks
2022-06-23 19:19:19 -04:00
- hlid: hard link identity (same if hardlinking same fs object)
2025-12-23 12:00:09 -05:00
- inode: inode number
2023-06-11 17:09:20 -04:00
- flags: file flags
2017-06-17 20:10:10 -04:00
2023-06-11 17:09:20 -04:00
- size: file size
2017-06-17 20:10:10 -04:00
- num_chunks: number of chunks in this file
2023-06-11 17:09:20 -04:00
- mtime: file modification time
- ctime: file change time
- atime: file access time
- isomtime: file modification time (ISO 8601 format)
- isoctime: file change time (ISO 8601 format)
- isoatime: file access time (ISO 8601 format)
2017-06-17 20:10:10 -04:00
- fingerprint: Fingerprint of the file content (may have false negatives), format: H(conditions)-H(chunk_ids)
2020-10-04 14:32:38 -04:00
- blake2b
- blake2s
2017-06-17 20:10:10 -04:00
- md5
- sha1
- sha224
- sha256
- sha384
2020-10-04 14:32:38 -04:00
- sha3_224
- sha3_256
- sha3_384
- sha3_512
2017-06-17 20:10:10 -04:00
- sha512
2023-06-11 17:09:20 -04:00
- archiveid: internal ID of the archive
- archivename: name of the archive
2023-02-26 15:30:28 -05:00
- extra: prepends {target} with " -> " for soft links and " link to " for hard links