create.rst.inc 6.9 KB

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