borg-rcreate.1 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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 "2023-09-14" "" "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 \(dqkey encryption key\(dq 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. \(dqleaving your keys inside your car\(dq (see \fIborg_key_export\fP).
  75. The encryption is done locally \- if you use a remote repository, 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 \(dqpassphrase\(dq 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 want \(dqpassphrase and having\-the\-key\(dq 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|.
  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}
  133. _
  134. T{
  135. K\-blake2\-chacha20\-poly1305
  136. T} T{
  137. BLAKE2b
  138. T} T{
  139. CHACHA20
  140. T} T{
  141. POLY1305
  142. T}
  143. _
  144. T{
  145. K\-chacha20\-poly1305
  146. T} T{
  147. HMAC\-SHA\-256
  148. T} T{
  149. CHACHA20
  150. T} T{
  151. POLY1305
  152. T}
  153. _
  154. T{
  155. K\-blake2\-aes\-ocb
  156. T} T{
  157. BLAKE2b
  158. T} T{
  159. AES256\-OCB
  160. T} T{
  161. AES256\-OCB
  162. T}
  163. _
  164. T{
  165. K\-aes\-ocb
  166. T} T{
  167. HMAC\-SHA\-256
  168. T} T{
  169. AES256\-OCB
  170. T} T{
  171. AES256\-OCB
  172. T}
  173. _
  174. T{
  175. authenticated\-blake2
  176. T} T{
  177. BLAKE2b
  178. T} T{
  179. none
  180. T} T{
  181. BLAKE2b
  182. T}
  183. _
  184. T{
  185. authenticated
  186. T} T{
  187. HMAC\-SHA\-256
  188. T} T{
  189. none
  190. T} T{
  191. HMAC\-SHA256
  192. T}
  193. _
  194. T{
  195. none
  196. T} T{
  197. SHA\-256
  198. T} T{
  199. none
  200. T} T{
  201. none
  202. T}
  203. _
  204. .TE
  205. .\" nanorst: inline-replace
  206. .
  207. .sp
  208. \fInone\fP mode uses no encryption and no authentication. You\(aqre advised NOT to use this mode
  209. as it would expose you to all sorts of issues (DoS, confidentiality, tampering, ...) in
  210. case of malicious activity in the repository.
  211. .sp
  212. If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect
  213. malicious tampering use an \fIauthenticated\fP mode. It\(aqs like \fIrepokey\fP minus encryption.
  214. To normally work with \fBauthenticated\fP repos, you will need the passphrase, but
  215. there is an emergency workaround, see \fBBORG_WORKAROUNDS=authenticated_no_key\fP docs.
  216. .SS Creating a related repository
  217. .sp
  218. You can use \fBborg rcreate \-\-other\-repo ORIG_REPO ...\fP to create a related repository
  219. that uses the same secret key material as the given other/original repository.
  220. .sp
  221. By default, only the ID key and chunker secret will be the same (these are important
  222. for deduplication) and the AE crypto keys will be newly generated random keys.
  223. .sp
  224. Optionally, if you use \fB\-\-copy\-crypt\-key\fP you can also keep the same crypt_key
  225. (used for authenticated encryption). Might be desired e.g. if you want to have less
  226. keys to manage.
  227. .sp
  228. Creating related repositories is useful e.g. if you want to use \fBborg transfer\fP later.
  229. .SH OPTIONS
  230. .sp
  231. See \fIborg\-common(1)\fP for common options of Borg commands.
  232. .SS options
  233. .INDENT 0.0
  234. .TP
  235. .BI \-\-other\-repo \ SRC_REPOSITORY
  236. reuse the key material from the other repository
  237. .TP
  238. .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
  239. select encryption key mode \fB(required)\fP
  240. .TP
  241. .B \-\-append\-only
  242. 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.
  243. .TP
  244. .BI \-\-storage\-quota \ QUOTA
  245. Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  246. .TP
  247. .B \-\-make\-parent\-dirs
  248. create the parent directories of the repository directory, if they are missing.
  249. .TP
  250. .B \-\-copy\-crypt\-key
  251. copy the crypt_key (used for authenticated encryption) from the key of the other repo (default: new random key).
  252. .UNINDENT
  253. .SH EXAMPLES
  254. .INDENT 0.0
  255. .INDENT 3.5
  256. .sp
  257. .nf
  258. .ft C
  259. # Local repository
  260. $ export BORG_REPO=/path/to/repo
  261. # recommended repokey AEAD crypto modes
  262. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  263. $ borg rcreate \-\-encryption=repokey\-chacha20\-poly1305
  264. $ borg rcreate \-\-encryption=repokey\-blake2\-aes\-ocb
  265. $ borg rcreate \-\-encryption=repokey\-blake2\-chacha20\-poly1305
  266. # no encryption, not recommended
  267. $ borg rcreate \-\-encryption=authenticated
  268. $ borg rcreate \-\-encryption=authenticated\-blake2
  269. $ borg rcreate \-\-encryption=none
  270. # Remote repository (accesses a remote borg via ssh)
  271. $ export BORG_REPO=ssh://user@hostname/~/backup
  272. # repokey: stores the (encrypted) key into <REPO_DIR>/config
  273. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  274. # keyfile: stores the (encrypted) key into ~/.config/borg/keys/
  275. $ borg rcreate \-\-encryption=keyfile\-aes\-ocb
  276. .ft P
  277. .fi
  278. .UNINDENT
  279. .UNINDENT
  280. .SH SEE ALSO
  281. .sp
  282. \fIborg\-common(1)\fP, \fIborg\-rdelete(1)\fP, \fIborg\-rlist(1)\fP, \fIborg\-check(1)\fP, \fIborg\-benchmark\-cpu(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
  283. .SH AUTHOR
  284. The Borg Collective
  285. .\" Generated by docutils manpage writer.
  286. .