borg.1 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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" 1 "2024-03-29" "" "borg backup tool"
  31. .SH NAME
  32. borg \- deduplicating and encrypting backup tool
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] <command> [options] [arguments]
  36. .SH DESCRIPTION
  37. .\" we don't include the README.rst here since we want to keep this terse.
  38. .
  39. .sp
  40. BorgBackup (short: Borg) is a deduplicating backup program.
  41. Optionally, it supports compression and authenticated encryption.
  42. .sp
  43. The main goal of Borg is to provide an efficient and secure way to backup data.
  44. The data deduplication technique used makes Borg suitable for daily backups
  45. since only changes are stored.
  46. The authenticated encryption technique makes it suitable for backups to not
  47. fully trusted targets.
  48. .sp
  49. Borg stores a set of files in an \fIarchive\fP\&. A \fIrepository\fP is a collection
  50. of \fIarchives\fP\&. The format of repositories is Borg\-specific. Borg does not
  51. distinguish archives from each other in any way other than their name,
  52. it does not matter when or where archives were created (e.g. different hosts).
  53. .SH EXAMPLES
  54. .SS A step\-by\-step example
  55. .INDENT 0.0
  56. .IP 1. 3
  57. Before a backup can be made a repository has to be initialized:
  58. .INDENT 3.0
  59. .INDENT 3.5
  60. .sp
  61. .nf
  62. .ft C
  63. $ borg init \-\-encryption=repokey /path/to/repo
  64. .ft P
  65. .fi
  66. .UNINDENT
  67. .UNINDENT
  68. .IP 2. 3
  69. Backup the \fB~/src\fP and \fB~/Documents\fP directories into an archive called
  70. \fIMonday\fP:
  71. .INDENT 3.0
  72. .INDENT 3.5
  73. .sp
  74. .nf
  75. .ft C
  76. $ borg create /path/to/repo::Monday ~/src ~/Documents
  77. .ft P
  78. .fi
  79. .UNINDENT
  80. .UNINDENT
  81. .IP 3. 3
  82. The next day create a new archive called \fITuesday\fP:
  83. .INDENT 3.0
  84. .INDENT 3.5
  85. .sp
  86. .nf
  87. .ft C
  88. $ borg create \-\-stats /path/to/repo::Tuesday ~/src ~/Documents
  89. .ft P
  90. .fi
  91. .UNINDENT
  92. .UNINDENT
  93. .sp
  94. This backup will be a lot quicker and a lot smaller since only new never
  95. before seen data is stored. The \fB\-\-stats\fP option causes Borg to
  96. output statistics about the newly created archive such as the amount of unique
  97. data (not shared with other archives):
  98. .INDENT 3.0
  99. .INDENT 3.5
  100. .sp
  101. .nf
  102. .ft C
  103. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  104. Archive name: Tuesday
  105. Archive fingerprint: bd31004d58f51ea06ff735d2e5ac49376901b21d58035f8fb05dbf866566e3c2
  106. Time (start): Tue, 2016\-02\-16 18:15:11
  107. Time (end): Tue, 2016\-02\-16 18:15:11
  108. Duration: 0.19 seconds
  109. Number of files: 127
  110. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  111. Original size Compressed size Deduplicated size
  112. This archive: 4.16 MB 4.17 MB 26.78 kB
  113. All archives: 8.33 MB 8.34 MB 4.19 MB
  114. Unique chunks Total chunks
  115. Chunk index: 132 261
  116. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  117. .ft P
  118. .fi
  119. .UNINDENT
  120. .UNINDENT
  121. .IP 4. 3
  122. List all archives in the repository:
  123. .INDENT 3.0
  124. .INDENT 3.5
  125. .sp
  126. .nf
  127. .ft C
  128. $ borg list /path/to/repo
  129. Monday Mon, 2016\-02\-15 19:14:44
  130. Tuesday Tue, 2016\-02\-16 19:15:11
  131. .ft P
  132. .fi
  133. .UNINDENT
  134. .UNINDENT
  135. .IP 5. 3
  136. List the contents of the \fIMonday\fP archive:
  137. .INDENT 3.0
  138. .INDENT 3.5
  139. .sp
  140. .nf
  141. .ft C
  142. $ borg list /path/to/repo::Monday
  143. drwxr\-xr\-x user group 0 Mon, 2016\-02\-15 18:22:30 home/user/Documents
  144. \-rw\-r\-\-r\-\- user group 7961 Mon, 2016\-02\-15 18:22:30 home/user/Documents/Important.doc
  145. \&...
  146. .ft P
  147. .fi
  148. .UNINDENT
  149. .UNINDENT
  150. .IP 6. 3
  151. Restore the \fIMonday\fP archive by extracting the files relative to the current directory:
  152. .INDENT 3.0
  153. .INDENT 3.5
  154. .sp
  155. .nf
  156. .ft C
  157. $ borg extract /path/to/repo::Monday
  158. .ft P
  159. .fi
  160. .UNINDENT
  161. .UNINDENT
  162. .IP 7. 3
  163. Delete the \fIMonday\fP archive (please note that this does \fBnot\fP free repo disk space):
  164. .INDENT 3.0
  165. .INDENT 3.5
  166. .sp
  167. .nf
  168. .ft C
  169. $ borg delete /path/to/repo::Monday
  170. .ft P
  171. .fi
  172. .UNINDENT
  173. .UNINDENT
  174. .IP 8. 3
  175. Recover disk space by compacting the segment files in the repo:
  176. .INDENT 3.0
  177. .INDENT 3.5
  178. .sp
  179. .nf
  180. .ft C
  181. $ borg compact /path/to/repo
  182. .ft P
  183. .fi
  184. .UNINDENT
  185. .UNINDENT
  186. .UNINDENT
  187. .sp
  188. \fBNOTE:\fP
  189. .INDENT 0.0
  190. .INDENT 3.5
  191. Borg is quiet by default (it works on WARNING log level).
  192. You can use options like \fB\-\-progress\fP or \fB\-\-list\fP to get specific
  193. reports during command execution. You can also add the \fB\-v\fP (or
  194. \fB\-\-verbose\fP or \fB\-\-info\fP) option to adjust the log level to INFO to
  195. get other informational messages.
  196. .UNINDENT
  197. .UNINDENT
  198. .SH NOTES
  199. .SS Positional Arguments and Options: Order matters
  200. .sp
  201. Borg only supports taking options (\fB\-s\fP and \fB\-\-progress\fP in the example)
  202. to the left or right of all positional arguments (\fBrepo::archive\fP and \fBpath\fP
  203. in the example), but not in between them:
  204. .INDENT 0.0
  205. .INDENT 3.5
  206. .sp
  207. .nf
  208. .ft C
  209. borg create \-s \-\-progress repo::archive path # good and preferred
  210. borg create repo::archive path \-s \-\-progress # also works
  211. borg create \-s repo::archive path \-\-progress # works, but ugly
  212. borg create repo::archive \-s \-\-progress path # BAD
  213. .ft P
  214. .fi
  215. .UNINDENT
  216. .UNINDENT
  217. .sp
  218. This is due to a problem in the argparse module: \fI\%https://bugs.python.org/issue15112\fP
  219. .SS Repository URLs
  220. .sp
  221. \fBLocal filesystem\fP (or locally mounted network filesystem):
  222. .sp
  223. \fB/path/to/repo\fP \- filesystem path to repo directory, absolute path
  224. .sp
  225. \fBpath/to/repo\fP \- filesystem path to repo directory, relative path
  226. .sp
  227. Also, stuff like \fB~/path/to/repo\fP or \fB~other/path/to/repo\fP works (this is
  228. expanded by your shell).
  229. .sp
  230. Note: you may also prepend a \fBfile://\fP to a filesystem path to get URL style.
  231. .sp
  232. \fBRemote repositories\fP accessed via ssh \fI\%user@host\fP:
  233. .sp
  234. \fBuser@host:/path/to/repo\fP \- remote repo, absolute path
  235. .sp
  236. \fBssh://user@host:port/path/to/repo\fP \- same, alternative syntax, port can be given
  237. .sp
  238. \fBRemote repositories with relative paths\fP can be given using this syntax:
  239. .sp
  240. \fBuser@host:path/to/repo\fP \- path relative to current directory
  241. .sp
  242. \fBuser@host:~/path/to/repo\fP \- path relative to user\(aqs home directory
  243. .sp
  244. \fBuser@host:~other/path/to/repo\fP \- path relative to other\(aqs home directory
  245. .sp
  246. Note: giving \fBuser@host:/./path/to/repo\fP or \fBuser@host:/~/path/to/repo\fP or
  247. \fBuser@host:/~other/path/to/repo\fP is also supported, but not required here.
  248. .sp
  249. \fBRemote repositories with relative paths, alternative syntax with port\fP:
  250. .sp
  251. \fBssh://user@host:port/./path/to/repo\fP \- path relative to current directory
  252. .sp
  253. \fBssh://user@host:port/~/path/to/repo\fP \- path relative to user\(aqs home directory
  254. .sp
  255. \fBssh://user@host:port/~other/path/to/repo\fP \- path relative to other\(aqs home directory
  256. .sp
  257. If you frequently need the same repo URL, it is a good idea to set the
  258. \fBBORG_REPO\fP environment variable to set a default for the repo URL:
  259. .INDENT 0.0
  260. .INDENT 3.5
  261. .sp
  262. .nf
  263. .ft C
  264. export BORG_REPO=\(aqssh://user@host:port/path/to/repo\(aq
  265. .ft P
  266. .fi
  267. .UNINDENT
  268. .UNINDENT
  269. .sp
  270. Then just leave away the repo URL if only a repo URL is needed and you want
  271. to use the default \- it will be read from BORG_REPO then.
  272. .sp
  273. Use \fB::\fP syntax to give the repo URL when syntax requires giving a positional
  274. argument for the repo (e.g. \fBborg mount :: /mnt\fP).
  275. .SS Repository / Archive Locations
  276. .sp
  277. Many commands want either a repository (just give the repo URL, see above) or
  278. an archive location, which is a repo URL followed by \fB::archive_name\fP\&.
  279. .sp
  280. Archive names must not contain the \fB/\fP (slash) character. For simplicity,
  281. maybe also avoid blanks or other characters that have special meaning on the
  282. shell or in a filesystem (borg mount will use the archive name as directory
  283. name).
  284. .sp
  285. If you have set BORG_REPO (see above) and an archive location is needed, use
  286. \fB::archive_name\fP \- the repo URL part is then read from BORG_REPO.
  287. .SS Logging
  288. .sp
  289. Borg writes all log output to stderr by default. But please note that something
  290. showing up on stderr does \fInot\fP indicate an error condition just because it is
  291. on stderr. Please check the log levels of the messages and the return code of
  292. borg for determining error, warning or success conditions.
  293. .sp
  294. If you want to capture the log output to a file, just redirect it:
  295. .INDENT 0.0
  296. .INDENT 3.5
  297. .sp
  298. .nf
  299. .ft C
  300. borg create repo::archive myfiles 2>> logfile
  301. .ft P
  302. .fi
  303. .UNINDENT
  304. .UNINDENT
  305. .sp
  306. Custom logging configurations can be implemented via BORG_LOGGING_CONF.
  307. .sp
  308. The log level of the builtin logging configuration defaults to WARNING.
  309. This is because we want Borg to be mostly silent and only output
  310. warnings, errors and critical messages, unless output has been requested
  311. by supplying an option that implies output (e.g. \fB\-\-list\fP or \fB\-\-progress\fP).
  312. .sp
  313. Log levels: DEBUG < INFO < WARNING < ERROR < CRITICAL
  314. .sp
  315. Use \fB\-\-debug\fP to set DEBUG log level \-
  316. to get debug, info, warning, error and critical level output.
  317. .sp
  318. Use \fB\-\-info\fP (or \fB\-v\fP or \fB\-\-verbose\fP) to set INFO log level \-
  319. to get info, warning, error and critical level output.
  320. .sp
  321. Use \fB\-\-warning\fP (default) to set WARNING log level \-
  322. to get warning, error and critical level output.
  323. .sp
  324. Use \fB\-\-error\fP to set ERROR log level \-
  325. to get error and critical level output.
  326. .sp
  327. Use \fB\-\-critical\fP to set CRITICAL log level \-
  328. to get critical level output.
  329. .sp
  330. While you can set misc. log levels, do not expect that every command will
  331. give different output on different log levels \- it\(aqs just a possibility.
  332. .sp
  333. \fBWARNING:\fP
  334. .INDENT 0.0
  335. .INDENT 3.5
  336. Options \fB\-\-critical\fP and \fB\-\-error\fP are provided for completeness,
  337. their usage is not recommended as you might miss important information.
  338. .UNINDENT
  339. .UNINDENT
  340. .SS Return codes
  341. .sp
  342. Borg can exit with the following return codes (rc):
  343. .TS
  344. center;
  345. |l|l|.
  346. _
  347. T{
  348. Return code
  349. T} T{
  350. Meaning
  351. T}
  352. _
  353. T{
  354. 0
  355. T} T{
  356. success (logged as INFO)
  357. T}
  358. _
  359. T{
  360. 1
  361. T} T{
  362. warning (operation reached its normal end, but there were warnings \-\-
  363. you should check the log, logged as WARNING)
  364. T}
  365. _
  366. T{
  367. 2
  368. T} T{
  369. error (like a fatal error, a local or remote exception, the operation
  370. did not reach its normal end, logged as ERROR)
  371. T}
  372. _
  373. T{
  374. 128+N
  375. T} T{
  376. killed by signal N (e.g. 137 == kill \-9)
  377. T}
  378. _
  379. .TE
  380. .sp
  381. If you use \fB\-\-show\-rc\fP, the return code is also logged at the indicated
  382. level as the last log entry.
  383. .SS Environment Variables
  384. .sp
  385. Borg uses some environment variables for automation:
  386. .INDENT 0.0
  387. .TP
  388. .B General:
  389. .INDENT 7.0
  390. .TP
  391. .B BORG_REPO
  392. When set, use the value to give the default repository location. If a command needs an archive
  393. parameter, you can abbreviate as \fB::archive\fP\&. If a command needs a repository parameter, you
  394. can either leave it away or abbreviate as \fB::\fP, if a positional parameter is required.
  395. .TP
  396. .B BORG_PASSPHRASE
  397. When set, use the value to answer the passphrase question for encrypted repositories.
  398. It is used when a passphrase is needed to access an encrypted repo as well as when a new
  399. passphrase should be initially set when initializing an encrypted repo.
  400. See also BORG_NEW_PASSPHRASE.
  401. .TP
  402. .B BORG_PASSCOMMAND
  403. When set, use the standard output of the command (trailing newlines are stripped) to answer the
  404. passphrase question for encrypted repositories.
  405. It is used when a passphrase is needed to access an encrypted repo as well as when a new
  406. passphrase should be initially set when initializing an encrypted repo. Note that the command
  407. is executed without a shell. So variables, like \fB$HOME\fP will work, but \fB~\fP won\(aqt.
  408. If BORG_PASSPHRASE is also set, it takes precedence.
  409. See also BORG_NEW_PASSPHRASE.
  410. .TP
  411. .B BORG_PASSPHRASE_FD
  412. When set, specifies a file descriptor to read a passphrase
  413. from. Programs starting borg may choose to open an anonymous pipe
  414. and use it to pass a passphrase. This is safer than passing via
  415. BORG_PASSPHRASE, because on some systems (e.g. Linux) environment
  416. can be examined by other processes.
  417. If BORG_PASSPHRASE or BORG_PASSCOMMAND are also set, they take precedence.
  418. .TP
  419. .B BORG_NEW_PASSPHRASE
  420. When set, use the value to answer the passphrase question when a \fBnew\fP passphrase is asked for.
  421. This variable is checked first. If it is not set, BORG_PASSPHRASE and BORG_PASSCOMMAND will also
  422. be checked.
  423. Main usecase for this is to fully automate \fBborg change\-passphrase\fP\&.
  424. .TP
  425. .B BORG_DISPLAY_PASSPHRASE
  426. When set, use the value to answer the \(dqdisplay the passphrase for verification\(dq question when defining a new passphrase for encrypted repositories.
  427. .TP
  428. .B BORG_HOST_ID
  429. Borg usually computes a host id from the FQDN plus the results of \fBuuid.getnode()\fP (which usually returns
  430. a unique id based on the MAC address of the network interface. Except if that MAC happens to be all\-zero \- in
  431. that case it returns a random value, which is not what we want (because it kills automatic stale lock removal).
  432. So, if you have a all\-zero MAC address or other reasons to better externally control the host id, just set this
  433. environment variable to a unique value. If all your FQDNs are unique, you can just use the FQDN. If not,
  434. use \fI\%fqdn@uniqueid\fP\&.
  435. .TP
  436. .B BORG_LOGGING_CONF
  437. When set, use the given filename as \fI\%INI\fP\-style logging configuration.
  438. A basic example conf can be found at \fBdocs/misc/logging.conf\fP\&.
  439. .TP
  440. .B BORG_RSH
  441. When set, use this command instead of \fBssh\fP\&. This can be used to specify ssh options, such as
  442. a custom identity file \fBssh \-i /path/to/private/key\fP\&. See \fBman ssh\fP for other options. Using
  443. the \fB\-\-rsh CMD\fP commandline option overrides the environment variable.
  444. .TP
  445. .B BORG_REMOTE_PATH
  446. When set, use the given path as borg executable on the remote (defaults to \(dqborg\(dq if unset).
  447. Using \fB\-\-remote\-path PATH\fP commandline option overrides the environment variable.
  448. .TP
  449. .B BORG_FILES_CACHE_SUFFIX
  450. When set to a value at least one character long, instructs borg to use a specifically named
  451. (based on the suffix) alternative files cache. This can be used to avoid loading and saving
  452. cache entries for backup sources other than the current sources.
  453. .TP
  454. .B BORG_FILES_CACHE_TTL
  455. When set to a numeric value, this determines the maximum \(dqtime to live\(dq for the files cache
  456. entries (default: 20). The files cache is used to quickly determine whether a file is unchanged.
  457. The FAQ explains this more detailed in: \fIalways_chunking\fP
  458. .TP
  459. .B BORG_SHOW_SYSINFO
  460. When set to no (default: yes), system information (like OS, Python version, ...) in
  461. exceptions is not shown.
  462. Please only use for good reasons as it makes issues harder to analyze.
  463. .TP
  464. .B BORG_FUSE_IMPL
  465. Choose the lowlevel FUSE implementation borg shall use for \fBborg mount\fP\&.
  466. This is a comma\-separated list of implementation names, they are tried in the
  467. given order, e.g.:
  468. .INDENT 7.0
  469. .IP \(bu 2
  470. \fBpyfuse3,llfuse\fP: default, first try to load pyfuse3, then try to load llfuse.
  471. .IP \(bu 2
  472. \fBllfuse,pyfuse3\fP: first try to load llfuse, then try to load pyfuse3.
  473. .IP \(bu 2
  474. \fBpyfuse3\fP: only try to load pyfuse3
  475. .IP \(bu 2
  476. \fBllfuse\fP: only try to load llfuse
  477. .IP \(bu 2
  478. \fBnone\fP: do not try to load an implementation
  479. .UNINDENT
  480. .TP
  481. .B BORG_SELFTEST
  482. This can be used to influence borg\(aqs builtin self\-tests. The default is to execute the tests
  483. at the beginning of each borg command invocation.
  484. .sp
  485. BORG_SELFTEST=disabled can be used to switch off the tests and rather save some time.
  486. Disabling is not recommended for normal borg users, but large scale borg storage providers can
  487. use this to optimize production servers after at least doing a one\-time test borg (with
  488. selftests not disabled) when installing or upgrading machines / OS / borg.
  489. .TP
  490. .B BORG_WORKAROUNDS
  491. A list of comma separated strings that trigger workarounds in borg,
  492. e.g. to work around bugs in other software.
  493. .sp
  494. Currently known strings are:
  495. .INDENT 7.0
  496. .TP
  497. .B basesyncfile
  498. Use the more simple BaseSyncFile code to avoid issues with sync_file_range.
  499. You might need this to run borg on WSL (Windows Subsystem for Linux) or
  500. in systemd.nspawn containers on some architectures (e.g. ARM).
  501. Using this does not affect data safety, but might result in a more bursty
  502. write to disk behaviour (not continuously streaming to disk).
  503. .TP
  504. .B retry_erofs
  505. Retry opening a file without O_NOATIME if opening a file with O_NOATIME
  506. caused EROFS. You will need this to make archives from volume shadow copies
  507. in WSL1 (Windows Subsystem for Linux 1).
  508. .TP
  509. .B authenticated_no_key
  510. Work around a lost passphrase or key for an \fBauthenticated\fP mode repository
  511. (these are only authenticated, but not encrypted).
  512. If the key is missing in the repository config, add \fBkey = anything\fP there.
  513. .sp
  514. This workaround is \fBonly\fP for emergencies and \fBonly\fP to extract data
  515. from an affected repository (read\-only access):
  516. .INDENT 7.0
  517. .INDENT 3.5
  518. .sp
  519. .nf
  520. .ft C
  521. BORG_WORKAROUNDS=authenticated_no_key borg extract repo::archive
  522. .ft P
  523. .fi
  524. .UNINDENT
  525. .UNINDENT
  526. .sp
  527. After you have extracted all data you need, you MUST delete the repository:
  528. .INDENT 7.0
  529. .INDENT 3.5
  530. .sp
  531. .nf
  532. .ft C
  533. BORG_WORKAROUNDS=authenticated_no_key borg delete repo
  534. .ft P
  535. .fi
  536. .UNINDENT
  537. .UNINDENT
  538. .sp
  539. Now you can init a fresh repo. Make sure you do not use the workaround any more.
  540. .TP
  541. .B ignore_invalid_archive_tam
  542. Work around invalid archive TAMs created by borg < 1.2.5, see #7791\&.
  543. .sp
  544. This workaround likely needs to get used only once when following the upgrade
  545. instructions for CVE\-2023\-36811, see \fIarchives_tam_vuln\fP\&.
  546. .sp
  547. In normal production operations, this workaround should never be used.
  548. .UNINDENT
  549. .UNINDENT
  550. .TP
  551. .B Some automatic \(dqanswerers\(dq (if set, they automatically answer confirmation questions):
  552. .INDENT 7.0
  553. .TP
  554. .B BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
  555. For \(dqWarning: Attempting to access a previously unknown unencrypted repository\(dq
  556. .TP
  557. .B BORG_RELOCATED_REPO_ACCESS_IS_OK=no (or =yes)
  558. For \(dqWarning: The repository at location ... was previously located at ...\(dq
  559. .TP
  560. .B BORG_CHECK_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
  561. For \(dqThis is a potentially dangerous function...\(dq (check \-\-repair)
  562. .TP
  563. .B BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES)
  564. For \(dqYou requested to completely DELETE the repository \fIincluding\fP all archives it contains:\(dq
  565. .UNINDENT
  566. .sp
  567. Note: answers are case sensitive. setting an invalid answer value might either give the default
  568. answer or ask you interactively, depending on whether retries are allowed (they by default are
  569. allowed). So please test your scripts interactively before making them a non\-interactive script.
  570. .UNINDENT
  571. .INDENT 0.0
  572. .TP
  573. .B Directories and files:
  574. .INDENT 7.0
  575. .TP
  576. .B BORG_BASE_DIR
  577. Defaults to \fB$HOME\fP or \fB~$USER\fP or \fB~\fP (in that order).
  578. If you want to move all borg\-specific folders to a custom path at once, all you need to do is
  579. to modify \fBBORG_BASE_DIR\fP: the other paths for cache, config etc. will adapt accordingly
  580. (assuming you didn\(aqt set them to a different custom value).
  581. .TP
  582. .B BORG_CACHE_DIR
  583. Defaults to \fB$BORG_BASE_DIR/.cache/borg\fP\&. If \fBBORG_BASE_DIR\fP is not explicitly set while
  584. \fI\%XDG env var\fP \fBXDG_CACHE_HOME\fP is set, then \fB$XDG_CACHE_HOME/borg\fP is being used instead.
  585. This directory contains the local cache and might need a lot
  586. of space for dealing with big repositories. Make sure you\(aqre aware of the associated
  587. security aspects of the cache location: \fIcache_security\fP
  588. .TP
  589. .B BORG_CONFIG_DIR
  590. Defaults to \fB$BORG_BASE_DIR/.config/borg\fP\&. If \fBBORG_BASE_DIR\fP is not explicitly set while
  591. \fI\%XDG env var\fP \fBXDG_CONFIG_HOME\fP is set, then \fB$XDG_CONFIG_HOME/borg\fP is being used instead.
  592. This directory contains all borg configuration directories, see the FAQ
  593. for a security advisory about the data in this directory: \fIhome_config_borg\fP
  594. .TP
  595. .B BORG_SECURITY_DIR
  596. Defaults to \fB$BORG_CONFIG_DIR/security\fP\&.
  597. This directory contains information borg uses to track its usage of NONCES (\(dqnumbers used
  598. once\(dq \- usually in encryption context) and other security relevant data.
  599. .TP
  600. .B BORG_KEYS_DIR
  601. Defaults to \fB$BORG_CONFIG_DIR/keys\fP\&.
  602. This directory contains keys for encrypted repositories.
  603. .TP
  604. .B BORG_KEY_FILE
  605. When set, use the given path as repository key file. Please note that this is only
  606. for rather special applications that externally fully manage the key files:
  607. .INDENT 7.0
  608. .IP \(bu 2
  609. this setting only applies to the keyfile modes (not to the repokey modes).
  610. .IP \(bu 2
  611. using a full, absolute path to the key file is recommended.
  612. .IP \(bu 2
  613. all directories in the given path must exist.
  614. .IP \(bu 2
  615. this setting forces borg to use the key file at the given location.
  616. .IP \(bu 2
  617. the key file must either exist (for most commands) or will be created (\fBborg init\fP).
  618. .IP \(bu 2
  619. you need to give a different path for different repositories.
  620. .IP \(bu 2
  621. you need to point to the correct key file matching the repository the command will operate on.
  622. .UNINDENT
  623. .TP
  624. .B TMPDIR
  625. This is where temporary files are stored (might need a lot of temporary space for some
  626. operations), see \fI\%tempfile\fP for details.
  627. .UNINDENT
  628. .TP
  629. .B Building:
  630. .INDENT 7.0
  631. .TP
  632. .B BORG_OPENSSL_PREFIX
  633. Adds given OpenSSL header file directory to the default locations (setup.py).
  634. .TP
  635. .B BORG_LIBLZ4_PREFIX
  636. Adds given prefix directory to the default locations. If a \(aqinclude/lz4.h\(aq is found Borg
  637. will be linked against the system liblz4 instead of a bundled implementation. (setup.py)
  638. .TP
  639. .B BORG_LIBZSTD_PREFIX
  640. Adds given prefix directory to the default locations. If a \(aqinclude/zstd.h\(aq is found Borg
  641. will be linked against the system libzstd instead of a bundled implementation. (setup.py)
  642. .UNINDENT
  643. .UNINDENT
  644. .sp
  645. Please note:
  646. .INDENT 0.0
  647. .IP \(bu 2
  648. Be very careful when using the \(dqyes\(dq sayers, the warnings with prompt exist for your / your data\(aqs security/safety.
  649. .IP \(bu 2
  650. Also be very careful when putting your passphrase into a script, make sure it has appropriate file permissions (e.g.
  651. mode 600, root:root).
  652. .UNINDENT
  653. .SS File systems
  654. .sp
  655. We strongly recommend against using Borg (or any other database\-like
  656. software) on non\-journaling file systems like FAT, since it is not
  657. possible to assume any consistency in case of power failures (or a
  658. sudden disconnect of an external drive or similar failures).
  659. .sp
  660. While Borg uses a data store that is resilient against these failures
  661. when used on journaling file systems, it is not possible to guarantee
  662. this with some hardware \-\- independent of the software used. We don\(aqt
  663. know a list of affected hardware.
  664. .sp
  665. If you are suspicious whether your Borg repository is still consistent
  666. and readable after one of the failures mentioned above occurred, run
  667. \fBborg check \-\-verify\-data\fP to make sure it is consistent.
  668. Requirements for Borg repository file systems
  669. .INDENT 0.0
  670. .IP \(bu 2
  671. Long file names
  672. .IP \(bu 2
  673. At least three directory levels with short names
  674. .IP \(bu 2
  675. Typically, file sizes up to a few hundred MB.
  676. Large repositories may require large files (>2 GB).
  677. .IP \(bu 2
  678. Up to 1000 files per directory.
  679. .IP \(bu 2
  680. rename(2) / MoveFile(Ex) should work as specified, i.e. on the same file system
  681. it should be a move (not a copy) operation, and in case of a directory
  682. it should fail if the destination exists and is not an empty directory,
  683. since this is used for locking.
  684. .IP \(bu 2
  685. Hardlinks are needed for \fIborg_upgrade\fP (if \fB\-\-inplace\fP option is not used).
  686. Also hardlinks are used for more safe and secure file updating (e.g. of the repo
  687. config file), but the code tries to work also if hardlinks are not supported.
  688. .UNINDENT
  689. .SS Units
  690. .sp
  691. To display quantities, Borg takes care of respecting the
  692. usual conventions of scale. Disk sizes are displayed in \fI\%decimal\fP, using powers of ten (so
  693. \fBkB\fP means 1000 bytes). For memory usage, \fI\%binary prefixes\fP are used, and are
  694. indicated using the \fI\%IEC binary prefixes\fP,
  695. using powers of two (so \fBKiB\fP means 1024 bytes).
  696. .SS Date and Time
  697. .sp
  698. We format date and time conforming to ISO\-8601, that is: YYYY\-MM\-DD and
  699. HH:MM:SS (24h clock).
  700. .sp
  701. For more information about that, see: \fI\%https://xkcd.com/1179/\fP
  702. .sp
  703. Unless otherwise noted, we display local date and time.
  704. Internally, we store and process date and time as UTC.
  705. .SS Resource Usage
  706. .sp
  707. Borg might use a lot of resources depending on the size of the data set it is dealing with.
  708. .sp
  709. If one uses Borg in a client/server way (with a ssh: repository),
  710. the resource usage occurs in part on the client and in another part on the
  711. server.
  712. .sp
  713. If one uses Borg as a single process (with a filesystem repo),
  714. all the resource usage occurs in that one process, so just add up client +
  715. server to get the approximate resource usage.
  716. .INDENT 0.0
  717. .TP
  718. .B CPU client:
  719. .INDENT 7.0
  720. .IP \(bu 2
  721. \fBborg create:\fP does chunking, hashing, compression, crypto (high CPU usage)
  722. .IP \(bu 2
  723. \fBchunks cache sync:\fP quite heavy on CPU, doing lots of hashtable operations.
  724. .IP \(bu 2
  725. \fBborg extract:\fP crypto, decompression (medium to high CPU usage)
  726. .IP \(bu 2
  727. \fBborg check:\fP similar to extract, but depends on options given.
  728. .IP \(bu 2
  729. \fBborg prune / borg delete archive:\fP low to medium CPU usage
  730. .IP \(bu 2
  731. \fBborg delete repo:\fP done on the server
  732. .UNINDENT
  733. .sp
  734. It won\(aqt go beyond 100% of 1 core as the code is currently single\-threaded.
  735. Especially higher zlib and lzma compression levels use significant amounts
  736. of CPU cycles. Crypto might be cheap on the CPU (if hardware accelerated) or
  737. expensive (if not).
  738. .TP
  739. .B CPU server:
  740. It usually doesn\(aqt need much CPU, it just deals with the key/value store
  741. (repository) and uses the repository index for that.
  742. .sp
  743. borg check: the repository check computes the checksums of all chunks
  744. (medium CPU usage)
  745. borg delete repo: low CPU usage
  746. .TP
  747. .B CPU (only for client/server operation):
  748. When using borg in a client/server way with a \fI\%ssh:\-type\fP repo, the ssh
  749. processes used for the transport layer will need some CPU on the client and
  750. on the server due to the crypto they are doing \- esp. if you are pumping
  751. big amounts of data.
  752. .TP
  753. .B Memory (RAM) client:
  754. The chunks index and the files index are read into memory for performance
  755. reasons. Might need big amounts of memory (see below).
  756. Compression, esp. lzma compression with high levels might need substantial
  757. amounts of memory.
  758. .TP
  759. .B Memory (RAM) server:
  760. The server process will load the repository index into memory. Might need
  761. considerable amounts of memory, but less than on the client (see below).
  762. .TP
  763. .B Chunks index (client only):
  764. Proportional to the amount of data chunks in your repo. Lots of chunks
  765. in your repo imply a big chunks index.
  766. It is possible to tweak the chunker params (see create options).
  767. .TP
  768. .B Files index (client only):
  769. Proportional to the amount of files in your last backups. Can be switched
  770. off (see create options), but next backup might be much slower if you do.
  771. The speed benefit of using the files cache is proportional to file size.
  772. .TP
  773. .B Repository index (server only):
  774. Proportional to the amount of data chunks in your repo. Lots of chunks
  775. in your repo imply a big repository index.
  776. It is possible to tweak the chunker params (see create options) to
  777. influence the amount of chunks being created.
  778. .TP
  779. .B Temporary files (client):
  780. Reading data and metadata from a FUSE mounted repository will consume up to
  781. the size of all deduplicated, small chunks in the repository. Big chunks
  782. won\(aqt be locally cached.
  783. .TP
  784. .B Temporary files (server):
  785. A non\-trivial amount of data will be stored on the remote temp directory
  786. for each client that connects to it. For some remotes, this can fill the
  787. default temporary directory at /tmp. This can be remediated by ensuring the
  788. $TMPDIR, $TEMP, or $TMP environment variable is properly set for the sshd
  789. process.
  790. For some OSes, this can be done just by setting the correct value in the
  791. \&.bashrc (or equivalent login config file for other shells), however in
  792. other cases it may be necessary to first enable \fBPermitUserEnvironment yes\fP
  793. in your \fBsshd_config\fP file, then add \fBenvironment=\(dqTMPDIR=/my/big/tmpdir\(dq\fP
  794. at the start of the public key to be used in the \fBauthorized_hosts\fP file.
  795. .TP
  796. .B Cache files (client only):
  797. Contains the chunks index and files index (plus a collection of single\-
  798. archive chunk indexes which might need huge amounts of disk space,
  799. depending on archive count and size \- see FAQ about how to reduce).
  800. .TP
  801. .B Network (only for client/server operation):
  802. If your repository is remote, all deduplicated (and optionally compressed/
  803. encrypted) data of course has to go over the connection (\fBssh://\fP repo url).
  804. If you use a locally mounted network filesystem, additionally some copy
  805. operations used for transaction support also go over the connection. If
  806. you backup multiple sources to one target repository, additional traffic
  807. happens for cache resynchronization.
  808. .UNINDENT
  809. .SS Support for file metadata
  810. .sp
  811. Besides regular file and directory structures, Borg can preserve
  812. .INDENT 0.0
  813. .IP \(bu 2
  814. symlinks (stored as symlink, the symlink is not followed)
  815. .IP \(bu 2
  816. special files:
  817. .INDENT 2.0
  818. .IP \(bu 2
  819. character and block device files (restored via mknod)
  820. .IP \(bu 2
  821. FIFOs (\(dqnamed pipes\(dq)
  822. .IP \(bu 2
  823. special file \fIcontents\fP can be backed up in \fB\-\-read\-special\fP mode.
  824. By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored.
  825. .UNINDENT
  826. .IP \(bu 2
  827. hardlinked regular files, devices, FIFOs (considering all items in the same archive)
  828. .IP \(bu 2
  829. timestamps in nanosecond precision: mtime, atime, ctime
  830. .IP \(bu 2
  831. other timestamps: birthtime (on platforms supporting it)
  832. .IP \(bu 2
  833. permissions:
  834. .INDENT 2.0
  835. .IP \(bu 2
  836. IDs of owning user and owning group
  837. .IP \(bu 2
  838. names of owning user and owning group (if the IDs can be resolved)
  839. .IP \(bu 2
  840. Unix Mode/Permissions (u/g/o permissions, suid, sgid, sticky)
  841. .UNINDENT
  842. .UNINDENT
  843. .sp
  844. On some platforms additional features are supported:
  845. .\" Yes/No's are grouped by reason/mechanism/reference.
  846. .
  847. .TS
  848. center;
  849. |l|l|l|l|.
  850. _
  851. T{
  852. Platform
  853. T} T{
  854. ACLs
  855. [5]
  856. T} T{
  857. xattr
  858. [6]
  859. T} T{
  860. Flags
  861. [7]
  862. T}
  863. _
  864. T{
  865. Linux
  866. T} T{
  867. Yes
  868. T} T{
  869. Yes
  870. T} T{
  871. Yes [1]
  872. T}
  873. _
  874. T{
  875. macOS
  876. T} T{
  877. Yes
  878. T} T{
  879. Yes
  880. T} T{
  881. Yes (all)
  882. T}
  883. _
  884. T{
  885. FreeBSD
  886. T} T{
  887. Yes
  888. T} T{
  889. Yes
  890. T} T{
  891. Yes (all)
  892. T}
  893. _
  894. T{
  895. OpenBSD
  896. T} T{
  897. n/a
  898. T} T{
  899. n/a
  900. T} T{
  901. Yes (all)
  902. T}
  903. _
  904. T{
  905. NetBSD
  906. T} T{
  907. n/a
  908. T} T{
  909. No [2]
  910. T} T{
  911. Yes (all)
  912. T}
  913. _
  914. T{
  915. Solaris and derivatives
  916. T} T{
  917. No [3]
  918. T} T{
  919. No [3]
  920. T} T{
  921. n/a
  922. T}
  923. _
  924. T{
  925. Windows (cygwin)
  926. T} T{
  927. No [4]
  928. T} T{
  929. No
  930. T} T{
  931. No
  932. T}
  933. _
  934. .TE
  935. .sp
  936. Other Unix\-like operating systems may work as well, but have not been tested at all.
  937. .sp
  938. Note that most of the platform\-dependent features also depend on the file system.
  939. For example, ntfs\-3g on Linux isn\(aqt able to convey NTFS ACLs.
  940. .IP [1] 5
  941. Only \(dqnodump\(dq, \(dqimmutable\(dq, \(dqcompressed\(dq and \(dqappend\(dq are supported.
  942. Feature request #618 for more flags.
  943. .IP [2] 5
  944. Feature request #1332
  945. .IP [3] 5
  946. Feature request #1337
  947. .IP [4] 5
  948. Cygwin tries to map NTFS ACLs to permissions with varying degrees of success.
  949. .IP [5] 5
  950. The native access control list mechanism of the OS. This normally limits access to
  951. non\-native ACLs. For example, NTFS ACLs aren\(aqt completely accessible on Linux with ntfs\-3g.
  952. .IP [6] 5
  953. extended attributes; key\-value pairs attached to a file, mainly used by the OS.
  954. This includes resource forks on Mac OS X.
  955. .IP [7] 5
  956. aka \fIBSD flags\fP\&. The Linux set of flags [1] is portable across platforms.
  957. The BSDs define additional flags.
  958. .SH SEE ALSO
  959. .sp
  960. \fIborg\-common(1)\fP for common command line options
  961. .sp
  962. \fIborg\-init(1)\fP,
  963. \fIborg\-create(1)\fP, \fIborg\-mount(1)\fP, \fIborg\-extract(1)\fP,
  964. \fIborg\-list(1)\fP, \fIborg\-info(1)\fP,
  965. \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP,
  966. \fIborg\-recreate(1)\fP
  967. .sp
  968. \fIborg\-compression(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP
  969. .INDENT 0.0
  970. .IP \(bu 2
  971. Main web site \fI\%https://www.borgbackup.org/\fP
  972. .IP \(bu 2
  973. Releases \fI\%https://github.com/borgbackup/borg/releases\fP
  974. .IP \(bu 2
  975. Changelog \fI\%https://github.com/borgbackup/borg/blob/master/docs/changes.rst\fP
  976. .IP \(bu 2
  977. GitHub \fI\%https://github.com/borgbackup/borg\fP
  978. .IP \(bu 2
  979. Security contact \fI\%https://borgbackup.readthedocs.io/en/latest/support.html#security\-contact\fP
  980. .UNINDENT
  981. .SH AUTHOR
  982. The Borg Collective
  983. orphan:
  984. .\" Generated by docutils manpage writer.
  985. .