borg-rcreate.1 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-RCREATE" 1 "2022-07-03" "" "borg backup tool"
  31. .SH NAME
  32. borg-rcreate \- Create a new, empty repository
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] rcreate [options]
  36. .SH DESCRIPTION
  37. .sp
  38. This command creates a new, empty repository. A repository is a filesystem
  39. directory containing the deduplicated data from zero or more archives.
  40. .SS Encryption mode TLDR
  41. .sp
  42. The encryption mode can only be configured when creating a new repository \- you can
  43. neither configure it on a per\-archive basis nor change the mode of an existing repository.
  44. This example will likely NOT give optimum performance on your machine (performance
  45. tips will come below):
  46. .INDENT 0.0
  47. .INDENT 3.5
  48. .sp
  49. .nf
  50. .ft C
  51. borg rcreate \-\-encryption repokey\-aes\-ocb
  52. .ft P
  53. .fi
  54. .UNINDENT
  55. .UNINDENT
  56. .sp
  57. Borg will:
  58. .INDENT 0.0
  59. .IP 1. 3
  60. Ask you to come up with a passphrase.
  61. .IP 2. 3
  62. Create a borg key (which contains some random secrets. See \fIkey_files\fP).
  63. .IP 3. 3
  64. Derive a "key encryption key" from your passphrase
  65. .IP 4. 3
  66. Encrypt and sign the key with the key encryption key
  67. .IP 5. 3
  68. Store the encrypted borg key inside the repository directory (in the repo config).
  69. This is why it is essential to use a secure passphrase.
  70. .IP 6. 3
  71. Encrypt and sign your backups to prevent anyone from reading or forging them unless they
  72. have the key and know the passphrase. Make sure to keep a backup of
  73. your key \fBoutside\fP the repository \- do not lock yourself out by
  74. "leaving your keys inside your car" (see \fIborg_key_export\fP).
  75. For remote backups the encryption is done locally \- the remote machine
  76. never sees your passphrase, your unencrypted key or your unencrypted files.
  77. Chunking and id generation are also based on your key to improve
  78. your privacy.
  79. .IP 7. 3
  80. Use the key when extracting files to decrypt them and to verify that the contents of
  81. the backups have not been accidentally or maliciously altered.
  82. .UNINDENT
  83. .SS Picking a passphrase
  84. .sp
  85. Make sure you use a good passphrase. Not too short, not too simple. The real
  86. encryption / decryption key is encrypted with / locked by your passphrase.
  87. If an attacker gets your key, he can\(aqt unlock and use it without knowing the
  88. passphrase.
  89. .sp
  90. Be careful with special or non\-ascii characters in your passphrase:
  91. .INDENT 0.0
  92. .IP \(bu 2
  93. Borg processes the passphrase as unicode (and encodes it as utf\-8),
  94. so it does not have problems dealing with even the strangest characters.
  95. .IP \(bu 2
  96. BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  97. .UNINDENT
  98. .sp
  99. So better use a long passphrase made from simple ascii chars than one that
  100. includes non\-ascii stuff or characters that are hard/impossible to enter on
  101. a different keyboard layout.
  102. .sp
  103. You can change your passphrase for existing repos at any time, it won\(aqt affect
  104. the encryption/decryption key or other secrets.
  105. .SS Choosing an encryption mode
  106. .sp
  107. Depending on your hardware, hashing and crypto performance may vary widely.
  108. The easiest way to find out about what\(aqs fastest is to run \fBborg benchmark cpu\fP\&.
  109. .sp
  110. \fIrepokey\fP modes: if you want ease\-of\-use and "passphrase" security is good enough \-
  111. the key will be stored in the repository (in \fBrepo_dir/config\fP).
  112. .sp
  113. \fIkeyfile\fP modes: if you rather want "passphrase and having\-the\-key" security \-
  114. the key will be stored in your home directory (in \fB~/.config/borg/keys\fP).
  115. .sp
  116. The following table is roughly sorted in order of preference, the better ones are
  117. in the upper part of the table, in the lower part is the old and/or unsafe(r) stuff:
  118. .\" nanorst: inline-fill
  119. .
  120. .TS
  121. center;
  122. |l|l|l|l|l|.
  123. _
  124. T{
  125. Mode (K = keyfile or repokey)
  126. T} T{
  127. ID\-Hash
  128. T} T{
  129. Encryption
  130. T} T{
  131. Authentication
  132. T} T{
  133. V >=
  134. T}
  135. _
  136. T{
  137. K\-blake2\-chacha20\-poly1305
  138. T} T{
  139. BLAKE2b
  140. T} T{
  141. CHACHA20
  142. T} T{
  143. POLY1305
  144. T} T{
  145. 2.0
  146. T}
  147. _
  148. T{
  149. K\-chacha20\-poly1305
  150. T} T{
  151. HMAC\-SHA\-256
  152. T} T{
  153. CHACHA20
  154. T} T{
  155. POLY1305
  156. T} T{
  157. 2.0
  158. T}
  159. _
  160. T{
  161. K\-blake2\-aes\-ocb
  162. T} T{
  163. BLAKE2b
  164. T} T{
  165. AES256\-OCB
  166. T} T{
  167. AES256\-OCB
  168. T} T{
  169. 2.0
  170. T}
  171. _
  172. T{
  173. K\-aes\-ocb
  174. T} T{
  175. HMAC\-SHA\-256
  176. T} T{
  177. AES256\-OCB
  178. T} T{
  179. AES256\-OCB
  180. T} T{
  181. 2.0
  182. T}
  183. _
  184. T{
  185. K\-blake2
  186. T} T{
  187. BLAKE2b
  188. T} T{
  189. AES256\-CTR
  190. T} T{
  191. BLAKE2b
  192. T} T{
  193. 1.1
  194. T}
  195. _
  196. T{
  197. K
  198. T} T{
  199. HMAC\-SHA\-256
  200. T} T{
  201. AES256\-CTR
  202. T} T{
  203. HMAC\-SHA256
  204. T} T{
  205. any
  206. T}
  207. _
  208. T{
  209. authenticated\-blake2
  210. T} T{
  211. BLAKE2b
  212. T} T{
  213. none
  214. T} T{
  215. BLAKE2b
  216. T} T{
  217. 1.1
  218. T}
  219. _
  220. T{
  221. authenticated
  222. T} T{
  223. HMAC\-SHA\-256
  224. T} T{
  225. none
  226. T} T{
  227. HMAC\-SHA256
  228. T} T{
  229. 1.1
  230. T}
  231. _
  232. T{
  233. none
  234. T} T{
  235. SHA\-256
  236. T} T{
  237. none
  238. T} T{
  239. none
  240. T} T{
  241. any
  242. T}
  243. _
  244. .TE
  245. .\" nanorst: inline-replace
  246. .
  247. .sp
  248. \fInone\fP mode uses no encryption and no authentication. You\(aqre advised to NOT use this mode
  249. as it would expose you to all sorts of issues (DoS, confidentiality, tampering, ...) in
  250. case of malicious activity in the repository.
  251. .sp
  252. If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect
  253. malicious tampering use an \fIauthenticated\fP mode. It\(aqs like \fIrepokey\fP minus encryption.
  254. .SH OPTIONS
  255. .sp
  256. See \fIborg\-common(1)\fP for common options of Borg commands.
  257. .SS optional arguments
  258. .INDENT 0.0
  259. .TP
  260. .BI \-\-other\-repo \ SRC_REPOSITORY
  261. reuse the key material from the other repository
  262. .TP
  263. .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
  264. select encryption key mode \fB(required)\fP
  265. .TP
  266. .B \-\-append\-only
  267. create an append\-only mode repository. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details.
  268. .TP
  269. .BI \-\-storage\-quota \ QUOTA
  270. Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  271. .TP
  272. .B \-\-make\-parent\-dirs
  273. create the parent directories of the repository directory, if they are missing.
  274. .UNINDENT
  275. .SH EXAMPLES
  276. .INDENT 0.0
  277. .INDENT 3.5
  278. .sp
  279. .nf
  280. .ft C
  281. # Local repository
  282. $ export BORG_REPO=/path/to/repo
  283. # recommended repokey AEAD crypto modes
  284. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  285. $ borg rcreate \-\-encryption=repokey\-chacha20\-poly1305
  286. $ borg rcreate \-\-encryption=repokey\-blake2\-aes\-ocb
  287. $ borg rcreate \-\-encryption=repokey\-blake2\-chacha20\-poly1305
  288. # no encryption, not recommended
  289. $ borg rcreate \-\-encryption=authenticated
  290. $ borg rcreate \-\-encryption=none
  291. # Remote repository (accesses a remote borg via ssh)
  292. $ export BORG_REPO=ssh://user@hostname/~/backup
  293. # repokey: stores the (encrypted) key into <REPO_DIR>/config
  294. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  295. # keyfile: stores the (encrypted) key into ~/.config/borg/keys/
  296. $ borg rcreate \-\-encryption=keyfile\-aes\-ocb
  297. .ft P
  298. .fi
  299. .UNINDENT
  300. .UNINDENT
  301. .SH SEE ALSO
  302. .sp
  303. \fIborg\-common(1)\fP, \fIborg\-rdelete(1)\fP, \fIborg\-rlist(1)\fP, \fIborg\-check(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
  304. .SH AUTHOR
  305. The Borg Collective
  306. .\" Generated by docutils manpage writer.
  307. .