borg-create.1 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH BORG-CREATE 1 "2017-02-12" "" "borg backup tool"
  4. .SH NAME
  5. borg-create \- Create new archive
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .sp
  35. borg create <options> ARCHIVE PATH
  36. .SH DESCRIPTION
  37. .sp
  38. This command creates a backup archive containing all files found while recursively
  39. traversing all paths specified. When giving \(aq\-\(aq as path, borg will read data
  40. from standard input and create a file \(aqstdin\(aq in the created archive from that
  41. data.
  42. .sp
  43. The archive will consume almost no disk space for files or parts of files that
  44. have already been stored in other archives.
  45. .sp
  46. The archive name needs to be unique. It must not end in \(aq.checkpoint\(aq or
  47. \(aq.checkpoint.N\(aq (with N being a number), because these names are used for
  48. checkpoints and treated in special ways.
  49. .sp
  50. In the archive name, you may use the following placeholders:
  51. {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
  52. .sp
  53. To speed up pulling backups over sshfs and similar network file systems which do
  54. not provide correct inode information the \-\-ignore\-inode flag can be used. This
  55. potentially decreases reliability of change detection, while avoiding always reading
  56. all files on these file systems.
  57. .sp
  58. See the output of the "borg help patterns" command for more help on exclude patterns.
  59. See the output of the "borg help placeholders" command for more help on placeholders.
  60. .SH OPTIONS
  61. .sp
  62. See \fIborg\-common(1)\fP for common options of Borg commands.
  63. .SS arguments
  64. .INDENT 0.0
  65. .TP
  66. .B ARCHIVE
  67. name of archive to create (must be also a valid directory name)
  68. .TP
  69. .B PATH
  70. paths to archive
  71. .UNINDENT
  72. .SS optional arguments
  73. .INDENT 0.0
  74. .TP
  75. .B \-n\fP,\fB \-\-dry\-run
  76. do not create a backup archive
  77. .TP
  78. .B \-s\fP,\fB \-\-stats
  79. print statistics for the created archive
  80. .TP
  81. .B \-p\fP,\fB \-\-progress
  82. 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
  83. .TP
  84. .B \-\-list
  85. output verbose list of items (files, dirs, ...)
  86. .TP
  87. .BI \-\-filter \ STATUSCHARS
  88. only display items with the given status characters
  89. .UNINDENT
  90. .SS Exclusion options
  91. .INDENT 0.0
  92. .TP
  93. .BI \-e \ PATTERN\fP,\fB \ \-\-exclude \ PATTERN
  94. exclude paths matching PATTERN
  95. .TP
  96. .BI \-\-exclude\-from \ EXCLUDEFILE
  97. read exclude patterns from EXCLUDEFILE, one per line
  98. .TP
  99. .B \-\-exclude\-caches
  100. exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.brynosaurus.com/cachedir/spec.html\fP)
  101. .TP
  102. .BI \-\-exclude\-if\-present \ NAME
  103. exclude directories that are tagged by containing a filesystem object with the given NAME
  104. .TP
  105. .B \-\-keep\-exclude\-tags\fP,\fB \-\-keep\-tag\-files
  106. keep tag objects (i.e.: arguments to \-\-exclude\-if\-present) in otherwise excluded caches/directories
  107. .UNINDENT
  108. .SS Filesystem options
  109. .INDENT 0.0
  110. .TP
  111. .B \-x\fP,\fB \-\-one\-file\-system
  112. stay in same file system, do not cross mount points
  113. .TP
  114. .B \-\-numeric\-owner
  115. only store numeric user and group identifiers
  116. .TP
  117. .B \-\-noatime
  118. do not store atime into archive
  119. .TP
  120. .B \-\-noctime
  121. do not store ctime into archive
  122. .TP
  123. .B \-\-ignore\-inode
  124. ignore inode data in the file metadata cache used to detect unchanged files.
  125. .TP
  126. .B \-\-read\-special
  127. 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.
  128. .UNINDENT
  129. .SS Archive options
  130. .INDENT 0.0
  131. .TP
  132. .BI \-\-comment \ COMMENT
  133. add a comment text to the archive
  134. .TP
  135. .BI \-\-timestamp \ TIMESTAMP
  136. manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory.
  137. .TP
  138. .BI \-c \ SECONDS\fP,\fB \ \-\-checkpoint\-interval \ SECONDS
  139. write checkpoint every SECONDS seconds (Default: 1800)
  140. .TP
  141. .BI \-\-chunker\-params \ PARAMS
  142. specify the chunker parameters (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: 19,23,21,4095
  143. .TP
  144. .BI \-C \ COMPRESSION\fP,\fB \ \-\-compression \ COMPRESSION
  145. select compression algorithm, see the output of the "borg help compression" command for details.
  146. .TP
  147. .BI \-\-compression\-from \ COMPRESSIONCONFIG
  148. read compression patterns from COMPRESSIONCONFIG, see the output of the "borg help compression" command for details.
  149. .UNINDENT
  150. .SH EXAMPLES
  151. .INDENT 0.0
  152. .INDENT 3.5
  153. .sp
  154. .nf
  155. .ft C
  156. # Backup ~/Documents into an archive named "my\-documents"
  157. $ borg create /path/to/repo::my\-documents ~/Documents
  158. # same, but list all files as we process them
  159. $ borg create \-\-list /path/to/repo::my\-documents ~/Documents
  160. # Backup ~/Documents and ~/src but exclude pyc files
  161. $ borg create /path/to/repo::my\-files \e
  162. ~/Documents \e
  163. ~/src \e
  164. \-\-exclude \(aq*.pyc\(aq
  165. # Backup home directories excluding image thumbnails (i.e. only
  166. # /home/*/.thumbnails is excluded, not /home/*/*/.thumbnails)
  167. $ borg create /path/to/repo::my\-files /home \e
  168. \-\-exclude \(aqre:^/home/[^/]+/\e.thumbnails/\(aq
  169. # Do the same using a shell\-style pattern
  170. $ borg create /path/to/repo::my\-files /home \e
  171. \-\-exclude \(aqsh:/home/*/.thumbnails\(aq
  172. # Backup the root filesystem into an archive named "root\-YYYY\-MM\-DD"
  173. # use zlib compression (good, but slow) \- default is no compression
  174. $ borg create \-C zlib,6 /path/to/repo::root\-{now:%Y\-%m\-%d} / \-\-one\-file\-system
  175. # Backup a remote host locally ("pull" style) using sshfs
  176. $ mkdir sshfs\-mount
  177. $ sshfs root@example.com:/ sshfs\-mount
  178. $ cd sshfs\-mount
  179. $ borg create /path/to/repo::example.com\-root\-{now:%Y\-%m\-%d} .
  180. $ cd ..
  181. $ fusermount \-u sshfs\-mount
  182. # Make a big effort in fine granular deduplication (big chunk management
  183. # overhead, needs a lot of RAM and disk space, see formula in internals
  184. # docs \- same parameters as borg < 1.0 or attic):
  185. $ borg create \-\-chunker\-params 10,23,16,4095 /path/to/repo::small /smallstuff
  186. # Backup a raw device (must not be active/in use/mounted at that time)
  187. $ dd if=/dev/sdx bs=10M | borg create /path/to/repo::my\-sdx \-
  188. # No compression (default)
  189. $ borg create /path/to/repo::arch ~
  190. # Super fast, low compression
  191. $ borg create \-\-compression lz4 /path/to/repo::arch ~
  192. # Less fast, higher compression (N = 0..9)
  193. $ borg create \-\-compression zlib,N /path/to/repo::arch ~
  194. # Even slower, even higher compression (N = 0..9)
  195. $ borg create \-\-compression lzma,N /path/to/repo::arch ~
  196. # Use short hostname, user name and current time in archive name
  197. $ borg create /path/to/repo::{hostname}\-{user}\-{now} ~
  198. # Similar, use the same datetime format as borg 1.1 will have as default
  199. $ borg create /path/to/repo::{hostname}\-{user}\-{now:%Y\-%m\-%dT%H:%M:%S} ~
  200. # As above, but add nanoseconds
  201. $ borg create /path/to/repo::{hostname}\-{user}\-{now:%Y\-%m\-%dT%H:%M:%S.%f} ~
  202. .ft P
  203. .fi
  204. .UNINDENT
  205. .UNINDENT
  206. .SH NOTES
  207. .sp
  208. The \-\-exclude patterns are not like tar. In tar \-\-exclude .bundler/gems will
  209. exclude foo/.bundler/gems. In borg it will not, you need to use \-\-exclude
  210. \(aq*/.bundler/gems\(aq to get the same effect. See \fBborg help patterns\fP for
  211. more information.
  212. .SS Item flags
  213. .sp
  214. \fB\-\-list\fP outputs a list of all files, directories and other
  215. file system items it considered (no matter whether they had content changes
  216. or not). For each item, it prefixes a single\-letter flag that indicates type
  217. and/or status of the item.
  218. .sp
  219. If you are interested only in a subset of that output, you can give e.g.
  220. \fB\-\-filter=AME\fP and it will only show regular files with A, M or E status (see
  221. below).
  222. .sp
  223. A uppercase character represents the status of a regular file relative to the
  224. "files" cache (not relative to the repo \-\- this is an issue if the files cache
  225. is not used). Metadata is stored in any case and for \(aqA\(aq and \(aqM\(aq also new data
  226. chunks are stored. For \(aqU\(aq all data chunks refer to already existing chunks.
  227. .INDENT 0.0
  228. .IP \(bu 2
  229. \(aqA\(aq = regular file, added (see also \fIa_status_oddity\fP in the FAQ)
  230. .IP \(bu 2
  231. \(aqM\(aq = regular file, modified
  232. .IP \(bu 2
  233. \(aqU\(aq = regular file, unchanged
  234. .IP \(bu 2
  235. \(aqE\(aq = regular file, an error happened while accessing/reading \fIthis\fP file
  236. .UNINDENT
  237. .sp
  238. A lowercase character means a file type other than a regular file,
  239. borg usually just stores their metadata:
  240. .INDENT 0.0
  241. .IP \(bu 2
  242. \(aqd\(aq = directory
  243. .IP \(bu 2
  244. \(aqb\(aq = block device
  245. .IP \(bu 2
  246. \(aqc\(aq = char device
  247. .IP \(bu 2
  248. \(aqh\(aq = regular file, hardlink (to already seen inodes)
  249. .IP \(bu 2
  250. \(aqs\(aq = symlink
  251. .IP \(bu 2
  252. \(aqf\(aq = fifo
  253. .UNINDENT
  254. .sp
  255. Other flags used include:
  256. .INDENT 0.0
  257. .IP \(bu 2
  258. \(aqi\(aq = backup data was read from standard input (stdin)
  259. .IP \(bu 2
  260. \(aq\-\(aq = dry run, item was \fInot\fP backed up
  261. .IP \(bu 2
  262. \(aqx\(aq = excluded, item was \fInot\fP backed up
  263. .IP \(bu 2
  264. \(aq?\(aq = missing status code (if you see this, please file a bug report!)
  265. .UNINDENT
  266. .SH SEE ALSO
  267. .sp
  268. \fIborg\-common(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-check(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP
  269. .SH AUTHOR
  270. The Borg Collective
  271. .\" Generated by docutils manpage writer.
  272. .