create.rst.inc 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 (see description) |
  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. | | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
  41. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
  43. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html) |
  45. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
  47. +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | | ``--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 |
  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 (see description)
  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. --pattern PATTERN experimental: include/exclude paths matching PATTERN
  100. --patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
  101. --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html)
  102. --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
  103. --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
  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. Backup speed is increased by not reprocessing files that are already part of
  133. existing archives and weren't modified. Normally, detecting file modifications
  134. will take inode information into consideration. This is problematic for files
  135. located on sshfs and similar network file systems which do not provide stable
  136. inode numbers, such files will always be considered modified. The
  137. ``--ignore-inode`` flag can be used to prevent this and improve performance.
  138. This flag will reduce reliability of change detection however, with files
  139. considered unmodified as long as their size and modification time are unchanged.
  140. The mount points of filesystems or filesystem snapshots should be the same for every
  141. creation of a new archive to ensure fast operation. This is because the file cache that
  142. is used to determine changed files quickly uses absolute filenames.
  143. If this is not possible, consider creating a bind mount to a stable location.
  144. The ``--progress`` option shows (from left to right) Original, Compressed and Deduplicated
  145. (O, C and D, respectively), then the Number of files (N) processed so far, followed by
  146. the currently processed path.
  147. See the output of the "borg help patterns" command for more help on exclude patterns.
  148. See the output of the "borg help placeholders" command for more help on placeholders.
  149. .. man NOTES
  150. The ``--exclude`` patterns are not like tar. In tar ``--exclude`` .bundler/gems will
  151. exclude foo/.bundler/gems. In borg it will not, you need to use ``--exclude``
  152. '\*/.bundler/gems' to get the same effect. See ``borg help patterns`` for
  153. more information.
  154. In addition to using ``--exclude`` patterns, it is possible to use
  155. ``--exclude-if-present`` to specify the name of a filesystem object (e.g. a file
  156. or folder name) which, when contained within another folder, will prevent the
  157. containing folder from being backed up. By default, the containing folder and
  158. all of its contents will be omitted from the backup. If, however, you wish to
  159. only include the objects specified by ``--exclude-if-present`` in your backup,
  160. and not include any other contents of the containing folder, this can be enabled
  161. through using the ``--keep-exclude-tags`` option.
  162. Item flags
  163. ++++++++++
  164. ``--list`` outputs a list of all files, directories and other
  165. file system items it considered (no matter whether they had content changes
  166. or not). For each item, it prefixes a single-letter flag that indicates type
  167. and/or status of the item.
  168. If you are interested only in a subset of that output, you can give e.g.
  169. ``--filter=AME`` and it will only show regular files with A, M or E status (see
  170. below).
  171. A uppercase character represents the status of a regular file relative to the
  172. "files" cache (not relative to the repo -- this is an issue if the files cache
  173. is not used). Metadata is stored in any case and for 'A' and 'M' also new data
  174. chunks are stored. For 'U' all data chunks refer to already existing chunks.
  175. - 'A' = regular file, added (see also :ref:`a_status_oddity` in the FAQ)
  176. - 'M' = regular file, modified
  177. - 'U' = regular file, unchanged
  178. - 'E' = regular file, an error happened while accessing/reading *this* file
  179. A lowercase character means a file type other than a regular file,
  180. borg usually just stores their metadata:
  181. - 'd' = directory
  182. - 'b' = block device
  183. - 'c' = char device
  184. - 'h' = regular file, hardlink (to already seen inodes)
  185. - 's' = symlink
  186. - 'f' = fifo
  187. Other flags used include:
  188. - 'i' = backup data was read from standard input (stdin)
  189. - '-' = dry run, item was *not* backed up
  190. - 'x' = excluded, item was *not* backed up
  191. - '?' = missing status code (if you see this, please file a bug report!)