create.rst.inc 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_create:
  3. borg create
  4. -----------
  5. .. code-block:: none
  6. borg [common options] create [options] ARCHIVE PATH
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) |
  13. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | | ``PATH`` | paths to archive |
  15. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | **optional arguments** |
  17. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``-n``, ``--dry-run`` | do not create a backup archive |
  19. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``-s``, ``--stats`` | print statistics for the created archive |
  21. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--list`` | output verbose list of items (files, dirs, ...) |
  23. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | | ``--filter STATUSCHARS`` | only display items with the given status characters |
  25. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | | ``--json`` | output stats as JSON. Implies ``--stats``. |
  27. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | | ``--no-cache-sync`` | experimental: do not synchronize the cache. Implies ``--no-files-cache``. |
  29. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | .. class:: borg-common-opt-ref |
  31. | |
  32. | :ref:`common_options` |
  33. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | **Exclusion options** |
  35. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  37. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  39. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html) |
  41. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
  43. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | | ``--keep-exclude-tags``, ``--keep-tag-files`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
  45. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
  47. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
  49. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | **Filesystem options** |
  51. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | | ``-x``, ``--one-file-system`` | stay in the same file system and do not store mount points of other file systems |
  53. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | | ``--numeric-owner`` | only store numeric user and group identifiers |
  55. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | | ``--noatime`` | do not store atime into archive |
  57. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | | ``--noctime`` | do not store ctime into archive |
  59. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | | ``--ignore-inode`` | ignore inode data in the file metadata cache used to detect unchanged files. |
  61. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | | ``--read-special`` | open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. |
  63. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | **Archive options** |
  65. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | | ``--comment COMMENT`` | add a comment text to the archive |
  67. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. |
  69. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
  71. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | | ``--chunker-params PARAMS`` | specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: 19,23,21,4095 |
  73. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
  75. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  76. .. raw:: html
  77. <script type='text/javascript'>
  78. $(document).ready(function () {
  79. $('.borg-options-table colgroup').remove();
  80. })
  81. </script>
  82. .. only:: latex
  83. ARCHIVE
  84. name of archive to create (must be also a valid directory name)
  85. PATH
  86. paths to archive
  87. optional arguments
  88. -n, --dry-run do not create a backup archive
  89. -s, --stats print statistics for the created archive
  90. --list output verbose list of items (files, dirs, ...)
  91. --filter STATUSCHARS only display items with the given status characters
  92. --json output stats as JSON. Implies ``--stats``.
  93. --no-cache-sync experimental: do not synchronize the cache. Implies ``--no-files-cache``.
  94. :ref:`common_options`
  95. |
  96. Exclusion options
  97. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  98. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  99. --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html)
  100. --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
  101. --keep-exclude-tags, --keep-tag-files if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive
  102. --pattern PATTERN experimental: include/exclude paths matching PATTERN
  103. --patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
  104. Filesystem options
  105. -x, --one-file-system stay in the same file system and do not store mount points of other file systems
  106. --numeric-owner only store numeric user and group identifiers
  107. --noatime do not store atime into archive
  108. --noctime do not store ctime into archive
  109. --ignore-inode ignore inode data in the file metadata cache used to detect unchanged files.
  110. --read-special open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files.
  111. Archive options
  112. --comment COMMENT add a comment text to the archive
  113. --timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory.
  114. -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
  115. --chunker-params PARAMS specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: 19,23,21,4095
  116. -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
  117. Description
  118. ~~~~~~~~~~~
  119. This command creates a backup archive containing all files found while recursively
  120. traversing all paths specified. Paths are added to the archive as they are given,
  121. that means if relative paths are desired, the command has to be run from the correct
  122. directory.
  123. When giving '-' as path, borg will read data from standard input and create a
  124. file 'stdin' in the created archive from that data.
  125. The archive will consume almost no disk space for files or parts of files that
  126. have already been stored in other archives.
  127. The archive name needs to be unique. It must not end in '.checkpoint' or
  128. '.checkpoint.N' (with N being a number), because these names are used for
  129. checkpoints and treated in special ways.
  130. In the archive name, you may use the following placeholders:
  131. {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
  132. To speed up pulling backups over sshfs and similar network file systems which do
  133. not provide correct inode information the ``--ignore-inode`` flag can be used. This
  134. potentially decreases reliability of change detection, while avoiding always reading
  135. all files on these file systems.
  136. The mount points of filesystems or filesystem snapshots should be the same for every
  137. creation of a new archive to ensure fast operation. This is because the file cache that
  138. is used to determine changed files quickly uses absolute filenames.
  139. If this is not possible, consider creating a bind mount to a stable location.
  140. The ``--progress`` option shows (from left to right) Original, Compressed and Deduplicated
  141. (O, C and D, respectively), then the Number of files (N) processed so far, followed by
  142. the currently processed path.
  143. See the output of the "borg help patterns" command for more help on exclude patterns.
  144. See the output of the "borg help placeholders" command for more help on placeholders.
  145. .. man NOTES
  146. The ``--exclude`` patterns are not like tar. In tar ``--exclude`` .bundler/gems will
  147. exclude foo/.bundler/gems. In borg it will not, you need to use ``--exclude``
  148. '\*/.bundler/gems' to get the same effect. See ``borg help patterns`` for
  149. more information.
  150. In addition to using ``--exclude`` patterns, it is possible to use
  151. ``--exclude-if-present`` to specify the name of a filesystem object (e.g. a file
  152. or folder name) which, when contained within another folder, will prevent the
  153. containing folder from being backed up. By default, the containing folder and
  154. all of its contents will be omitted from the backup. If, however, you wish to
  155. only include the objects specified by ``--exclude-if-present`` in your backup,
  156. and not include any other contents of the containing folder, this can be enabled
  157. through using the ``--keep-exclude-tags`` option.
  158. Item flags
  159. ++++++++++
  160. ``--list`` outputs a list of all files, directories and other
  161. file system items it considered (no matter whether they had content changes
  162. or not). For each item, it prefixes a single-letter flag that indicates type
  163. and/or status of the item.
  164. If you are interested only in a subset of that output, you can give e.g.
  165. ``--filter=AME`` and it will only show regular files with A, M or E status (see
  166. below).
  167. A uppercase character represents the status of a regular file relative to the
  168. "files" cache (not relative to the repo -- this is an issue if the files cache
  169. is not used). Metadata is stored in any case and for 'A' and 'M' also new data
  170. chunks are stored. For 'U' all data chunks refer to already existing chunks.
  171. - 'A' = regular file, added (see also :ref:`a_status_oddity` in the FAQ)
  172. - 'M' = regular file, modified
  173. - 'U' = regular file, unchanged
  174. - 'E' = regular file, an error happened while accessing/reading *this* file
  175. A lowercase character means a file type other than a regular file,
  176. borg usually just stores their metadata:
  177. - 'd' = directory
  178. - 'b' = block device
  179. - 'c' = char device
  180. - 'h' = regular file, hardlink (to already seen inodes)
  181. - 's' = symlink
  182. - 'f' = fifo
  183. Other flags used include:
  184. - 'i' = backup data was read from standard input (stdin)
  185. - '-' = dry run, item was *not* backed up
  186. - 'x' = excluded, item was *not* backed up
  187. - '?' = missing status code (if you see this, please file a bug report!)