create.rst.inc 6.9 KB

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