frontends.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. .. include:: ../global.rst.inc
  2. .. highlight:: none
  3. .. _json_output:
  4. All about JSON: How to develop frontends
  5. ========================================
  6. Borg does not have a public API on the Python level. That does not keep you from writing :code:`import borg`,
  7. but does mean that there are no release-to-release guarantees on what you might find in that package, not
  8. even for point releases (1.1.x), and there is no documentation beyond the code and the internals documents.
  9. Borg does on the other hand provide an API on a command-line level. In other words, a frontend should
  10. (for example) create a backup archive just invoke :ref:`borg_create`, give commandline parameters/options
  11. as needed and parse JSON output from borg.
  12. Important: JSON output is expected to be UTF-8, but currently borg depends on the locale being configured
  13. for that (must be a UTF-8 locale and *not* "C" or "ascii"), so that Python will choose to encode to UTF-8.
  14. The same applies to any inputs read by borg, they are expected to be UTF-8 encoded also.
  15. On POSIX systems, you can usually set environment vars to choose a UTF-8 locale:
  16. ::
  17. export LANG=en_US.UTF-8
  18. export LC_CTYPE=en_US.UTF-8
  19. Another way to get Python's stdin/stdout/stderr streams to use UTF-8 encoding (without having
  20. a UTF-8 locale / LANG / LC_CTYPE) is:
  21. ::
  22. export PYTHONIOENCODING=utf-8
  23. See :issue:`2273` for more details.
  24. Dealing with non-unicode byte sequences and JSON limitations
  25. ------------------------------------------------------------
  26. Paths on POSIX systems can have arbitrary bytes in them (except 0x00 which is used as string terminator in C).
  27. Nowadays, UTF-8 encoded paths (which decode to valid unicode) are the usual thing, but a lot of systems
  28. still have paths from the past, when other, non-unicode codings were used. Especially old Samba shares often
  29. have wild mixtures of misc. encodings, sometimes even very broken stuff.
  30. borg deals with such non-unicode paths ("with funny/broken characters") by decoding such byte sequences using
  31. UTF-8 coding and "surrogateescape" error handling mode, which maps invalid bytes to special unicode code points
  32. (surrogate escapes). When encoding such a unicode string back to a byte sequence, the original byte sequence
  33. will be reproduced exactly.
  34. JSON should only contain valid unicode text without any surrogate escapes, so we can't just directly have a
  35. surrogate-escaped path in JSON ("path" is only one example, this also affects other text-like content).
  36. Borg deals with this situation like this (since borg 2.0):
  37. For a valid unicode path (no surrogate escapes), the JSON will only have "path": path.
  38. For a non-unicode path (with surrogate escapes), the JSON will have 2 entries:
  39. - "path": path_approximation (pure valid unicode, all invalid bytes will show up as "?")
  40. - "path_b64": path_bytes_base64_encoded (if you decode the base64, you get the original path byte string)
  41. JSON users need to pick whatever suits their needs best. The suggested procedure (shown for "path") is:
  42. - check if there is a "path_b64" key.
  43. - if it is there, you will know that the original bytes path did not cleanly UTF-8-decode into unicode (has
  44. some invalid bytes) and that the string given by the "path" key is only an approximation, but not the precise
  45. path. if you need precision, you must base64-decode the value of "path_b64" and deal with the arbitrary byte
  46. string you'll get. if an approximation is fine, use the value of the "path" key.
  47. - if it is not there, the value of the "path" key is all you need (the original bytes path is its UTF-8 encoding).
  48. Logging
  49. -------
  50. Especially for graphical frontends it is important to be able to convey and reformat progress information
  51. in meaningful ways. The ``--log-json`` option turns the stderr stream of Borg into a stream of JSON lines,
  52. where each line is a JSON object. The *type* key of the object determines its other contents.
  53. .. warning:: JSON logging requires successful argument parsing. Even with ``--log-json`` specified, a
  54. parsing error will be printed in plain text, because logging set-up happens after all arguments are
  55. parsed.
  56. The following types are in use. Progress information is governed by the usual rules for progress information,
  57. it is not produced unless ``--progress`` is specified.
  58. archive_progress
  59. Output during operations creating archives (:ref:`borg_create` and :ref:`borg_recreate`).
  60. The following keys exist, each represents the current progress.
  61. original_size
  62. Original size of data processed so far (before compression and deduplication, may be empty/absent)
  63. compressed_size
  64. Compressed size (may be empty/absent)
  65. deduplicated_size
  66. Deduplicated size (may be empty/absent)
  67. nfiles
  68. Number of (regular) files processed so far (may be empty/absent)
  69. path
  70. Current path (may be empty/absent)
  71. time
  72. Unix timestamp (float)
  73. finished
  74. boolean indicating whether the operation has finished, only the last object for an *operation*
  75. can have this property set to *true*.
  76. progress_message
  77. A message-based progress information with no concrete progress information, just a message
  78. saying what is currently being worked on.
  79. operation
  80. unique, opaque integer ID of the operation
  81. :ref:`msgid <msgid>`
  82. Message ID of the operation (may be *null*)
  83. finished
  84. boolean indicating whether the operation has finished, only the last object for an *operation*
  85. can have this property set to *true*.
  86. message
  87. current progress message (may be empty/absent)
  88. time
  89. Unix timestamp (float)
  90. progress_percent
  91. Absolute progress information with defined end/total and current value.
  92. operation
  93. unique, opaque integer ID of the operation
  94. :ref:`msgid <msgid>`
  95. Message ID of the operation (may be *null*)
  96. finished
  97. boolean indicating whether the operation has finished, only the last object for an *operation*
  98. can have this property set to *true*.
  99. message
  100. A formatted progress message, this will include the percentage and perhaps other information
  101. (absent for finished == true)
  102. current
  103. Current value (always less-or-equal to *total*, absent for finished == true)
  104. info
  105. Array that describes the current item, may be *null*, contents depend on *msgid*
  106. (absent for finished == true)
  107. total
  108. Total value (absent for finished == true)
  109. time
  110. Unix timestamp (float)
  111. file_status
  112. This is only output by :ref:`borg_create` and :ref:`borg_recreate` if ``--list`` is specified. The usual
  113. rules for the file listing applies, including the ``--filter`` option.
  114. status
  115. Single-character status as for regular list output
  116. path
  117. Path of the file system object
  118. log_message
  119. Any regular log output invokes this type. Regular log options and filtering applies to these as well.
  120. time
  121. Unix timestamp (float)
  122. levelname
  123. Upper-case log level name (also called severity). Defined levels are: DEBUG, INFO, WARNING, ERROR, CRITICAL
  124. name
  125. Name of the emitting entity
  126. message
  127. Formatted log message
  128. :ref:`msgid <msgid>`
  129. Message ID, may be *null* or absent
  130. See Prompts_ for the types used by prompts.
  131. .. rubric:: Examples (reformatted, each object would be on exactly one line)
  132. .. highlight:: json
  133. :ref:`borg_extract` progress::
  134. {"message": "100.0% Extracting: src/borgbackup.egg-info/entry_points.txt",
  135. "current": 13000228, "total": 13004993, "info": ["src/borgbackup.egg-info/entry_points.txt"],
  136. "operation": 1, "msgid": "extract", "type": "progress_percent", "finished": false}
  137. {"message": "100.0% Extracting: src/borgbackup.egg-info/SOURCES.txt",
  138. "current": 13004993, "total": 13004993, "info": ["src/borgbackup.egg-info/SOURCES.txt"],
  139. "operation": 1, "msgid": "extract", "type": "progress_percent", "finished": false}
  140. {"operation": 1, "msgid": "extract", "type": "progress_percent", "finished": true}
  141. :ref:`borg_create` file listing with progress::
  142. {"original_size": 0, "compressed_size": 0, "deduplicated_size": 0, "nfiles": 0, "type": "archive_progress", "path": "src"}
  143. {"type": "file_status", "status": "U", "path": "src/borgbackup.egg-info/entry_points.txt"}
  144. {"type": "file_status", "status": "U", "path": "src/borgbackup.egg-info/SOURCES.txt"}
  145. {"type": "file_status", "status": "d", "path": "src/borgbackup.egg-info"}
  146. {"type": "file_status", "status": "d", "path": "src"}
  147. {"original_size": 13176040, "compressed_size": 11386863, "deduplicated_size": 503, "nfiles": 277, "type": "archive_progress", "path": ""}
  148. Internal transaction progress::
  149. {"message": "Saving files cache", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false}
  150. {"message": "Saving cache config", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false}
  151. {"message": "Saving chunks cache", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false}
  152. {"operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": true}
  153. A debug log message::
  154. {"message": "35 self tests completed in 0.08 seconds",
  155. "type": "log_message", "created": 1488278449.5575905, "levelname": "DEBUG", "name": "borg.archiver"}
  156. Prompts
  157. -------
  158. Prompts assume a JSON form as well when the ``--log-json`` option is specified. Responses
  159. are still read verbatim from *stdin*, while prompts are JSON messages printed to *stderr*,
  160. just like log messages.
  161. Prompts use the *question_prompt* and *question_prompt_retry* types for the prompt itself,
  162. and *question_invalid_answer*, *question_accepted_default*, *question_accepted_true*,
  163. *question_accepted_false* and *question_env_answer* types for information about
  164. prompt processing.
  165. The *message* property contains the same string displayed regularly in the same situation,
  166. while the *msgid* property may contain a msgid_, typically the name of the
  167. environment variable that can be used to override the prompt. It is the same for all JSON
  168. messages pertaining to the same prompt.
  169. .. rubric:: Examples (reformatted, each object would be on exactly one line)
  170. .. highlight:: none
  171. Providing an invalid answer::
  172. {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING",
  173. "message": "... Type 'YES' if you understand this and want to continue: "}
  174. incorrect answer # input on stdin
  175. {"type": "question_invalid_answer", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": false,
  176. "message": "Invalid answer, aborting."}
  177. Providing a false (negative) answer::
  178. {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING",
  179. "message": "... Type 'YES' if you understand this and want to continue: "}
  180. NO # input on stdin
  181. {"type": "question_accepted_false", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING",
  182. "message": "Aborting.", "is_prompt": false}
  183. Providing a true (affirmative) answer::
  184. {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING",
  185. "message": "... Type 'YES' if you understand this and want to continue: "}
  186. YES # input on stdin
  187. # no further output, just like the prompt without --log-json
  188. Passphrase prompts
  189. ------------------
  190. Passphrase prompts should be handled differently. Use the environment variables *BORG_PASSPHRASE*
  191. and *BORG_NEW_PASSPHRASE* (see :ref:`env_vars` for reference) to pass passphrases to Borg, don't
  192. use the interactive passphrase prompts.
  193. When setting a new passphrase (:ref:`borg_repo-create`, :ref:`borg_key_change-passphrase`) normally
  194. Borg prompts whether it should display the passphrase. This can be suppressed by setting
  195. the environment variable *BORG_DISPLAY_PASSPHRASE* to *no*.
  196. When "confronted" with an unknown repository, where the application does not know whether
  197. the repository is encrypted, the following algorithm can be followed to detect encryption:
  198. 1. Set *BORG_PASSPHRASE* to gibberish (for example a freshly generated UUID4, which cannot
  199. possibly be the passphrase)
  200. 2. Invoke ``borg list repository ...``
  201. 3. If this fails, due the repository being encrypted and the passphrase obviously being
  202. wrong, you'll get an error with the *PassphraseWrong* msgid.
  203. The repository is encrypted, for further access the application will need the passphrase.
  204. 4. If this does not fail, then the repository is not encrypted.
  205. Standard output
  206. ---------------
  207. *stdout* is different and more command-dependent than logging. Commands like :ref:`borg_info`, :ref:`borg_create`
  208. and :ref:`borg_list` implement a ``--json`` option which turns their regular output into a single JSON object.
  209. Some commands, like :ref:`borg_list` and :ref:`borg_diff`, can produce *a lot* of JSON. Since many JSON implementations
  210. don't support a streaming mode of operation, which is pretty much required to deal with this amount of JSON, these
  211. commands implement a ``--json-lines`` option which generates output in the `JSON lines <http://jsonlines.org/>`_ format,
  212. which is simply a number of JSON objects separated by new lines.
  213. Dates are formatted according to ISO 8601 in local time. No explicit time zone is specified *at this time*
  214. (subject to change). The equivalent strftime format string is '%Y-%m-%dT%H:%M:%S.%f',
  215. e.g. ``2017-08-07T12:27:20.123456``.
  216. The root object of '--json' output will contain at least a *repository* key with an object containing:
  217. id
  218. The ID of the repository, normally 64 hex characters
  219. location
  220. Canonicalized repository path, thus this may be different from what is specified on the command line
  221. last_modified
  222. Date when the repository was last modified by the Borg client
  223. The *encryption* key, if present, contains:
  224. mode
  225. Textual encryption mode name (same as :ref:`borg_repo-create` ``--encryption`` names)
  226. keyfile
  227. Path to the local key file used for access. Depending on *mode* this key may be absent.
  228. The *cache* key, if present, contains:
  229. path
  230. Path to the local repository cache
  231. stats
  232. Object containing cache stats:
  233. total_chunks
  234. Number of chunks
  235. total_unique_chunks
  236. Number of unique chunks
  237. total_size
  238. Total uncompressed size of all chunks multiplied with their reference counts
  239. unique_size
  240. Uncompressed size of all chunks
  241. .. highlight: json
  242. Example *borg info* output::
  243. {
  244. "cache": {
  245. "path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  246. "stats": {
  247. "total_chunks": 511533,
  248. "total_size": 22635749792,
  249. "total_unique_chunks": 54892,
  250. "unique_size": 2449675468
  251. }
  252. },
  253. "encryption": {
  254. "mode": "repokey"
  255. },
  256. "repository": {
  257. "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  258. "last_modified": "2017-08-07T12:27:20.789123",
  259. "location": "/home/user/testrepo"
  260. },
  261. "security_dir": "/home/user/.config/borg/security/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  262. "archives": []
  263. }
  264. Archive formats
  265. +++++++++++++++
  266. :ref:`borg_info` uses an extended format for archives, which is more expensive to retrieve, while
  267. :ref:`borg_list` uses a simpler format that is faster to retrieve. Either return archives in an
  268. array under the *archives* key, while :ref:`borg_create` returns a single archive object under the
  269. *archive* key.
  270. Both formats contain a *name* key with the archive name, the *id* key with the hexadecimal archive ID,
  271. and the *start* key with the start timestamp.
  272. *borg info* and *borg create* further have:
  273. end
  274. End timestamp
  275. duration
  276. Duration in seconds between start and end in seconds (float)
  277. stats
  278. Archive statistics (freshly calculated, this is what makes "info" more expensive)
  279. original_size
  280. Size of files and metadata before compression
  281. compressed_size
  282. Size after compression
  283. deduplicated_size
  284. Deduplicated size (against the current repository, not when the archive was created)
  285. nfiles
  286. Number of regular files in the archive
  287. command_line
  288. Array of strings of the command line that created the archive
  289. The note about paths from above applies here as well.
  290. chunker_params
  291. The chunker parameters the archive has been created with.
  292. :ref:`borg_info` further has:
  293. hostname
  294. Hostname of the creating host
  295. username
  296. Name of the creating user
  297. comment
  298. Archive comment, if any
  299. Some keys/values are more expensive to compute than others (e.g. because it requires opening the archive,
  300. not just the manifest). To optimize for speed, `borg list repo` does not determine these values except
  301. when they are requested. The `--format` option is used for that (for normal mode as well as for `--json`
  302. mode), so, to have the comment included in the json output, you will need:
  303. ::
  304. borg list repo --format "{name}{comment}" --json`
  305. Example of a simple archive listing (``borg list --last 1 --json``)::
  306. {
  307. "archives": [
  308. {
  309. "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a",
  310. "name": "host-system-backup-2017-02-27",
  311. "start": "2017-08-07T12:27:20.789123"
  312. }
  313. ],
  314. "encryption": {
  315. "mode": "repokey"
  316. },
  317. "repository": {
  318. "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  319. "last_modified": "2017-08-07T12:27:20.789123",
  320. "location": "/home/user/repository"
  321. }
  322. }
  323. The same archive with more information (``borg info --last 1 --json``)::
  324. {
  325. "archives": [
  326. {
  327. "chunker_params": [
  328. "buzhash",
  329. 13,
  330. 23,
  331. 16,
  332. 4095
  333. ],
  334. "command_line": [
  335. "/home/user/.local/bin/borg",
  336. "create",
  337. "/home/user/repository",
  338. "..."
  339. ],
  340. "comment": "",
  341. "duration": 5.641542,
  342. "end": "2017-02-27T12:27:20.789123",
  343. "hostname": "host",
  344. "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a",
  345. "name": "host-system-backup-2017-02-27",
  346. "start": "2017-02-27T12:27:20.789123",
  347. "stats": {
  348. "compressed_size": 1880961894,
  349. "deduplicated_size": 2791,
  350. "nfiles": 53669,
  351. "original_size": 2400471280
  352. },
  353. "username": "user"
  354. }
  355. ],
  356. "cache": {
  357. "path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  358. "stats": {
  359. "total_chunks": 511533,
  360. "total_size": 22635749792,
  361. "total_unique_chunks": 54892,
  362. "unique_size": 2449675468
  363. }
  364. },
  365. "encryption": {
  366. "mode": "repokey"
  367. },
  368. "repository": {
  369. "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23",
  370. "last_modified": "2017-08-07T12:27:20.789123",
  371. "location": "/home/user/repository"
  372. }
  373. }
  374. File listings
  375. +++++++++++++
  376. Each archive item (file, directory, ...) is described by one object in the :ref:`borg_list` output.
  377. Refer to the *borg list* documentation for the available keys and their meaning.
  378. Example (excerpt) of ``borg list --json-lines``::
  379. {"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux", "target": "", "flags": null, "mtime": "2017-02-27T12:27:20.023407", "size": 0}
  380. {"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux/baz", "target": "", "flags": null, "mtime": "2017-02-27T12:27:20.585407", "size": 0}
  381. Archive Differencing
  382. ++++++++++++++++++++
  383. Each archive difference item (file contents, user/group/mode) output by :ref:`borg_diff` is represented by an *ItemDiff* object.
  384. The properties of an *ItemDiff* object are:
  385. path:
  386. The filename/path of the *Item* (file, directory, symlink).
  387. changes:
  388. A list of *Change* objects describing the changes made to the item in the two archives. For example,
  389. there will be two changes if the contents of a file are changed, and its ownership are changed.
  390. The *Change* object can contain a number of properties depending on the type of change that occurred.
  391. If a 'property' is not required for the type of change, it is not output.
  392. The possible properties of a *Change* object are:
  393. type:
  394. The **type** property is always present. It identifies the type of change and will be one of these values:
  395. - *modified* - file contents changed.
  396. - *added* - the file was added.
  397. - *removed* - the file was removed.
  398. - *added directory* - the directory was added.
  399. - *removed directory* - the directory was removed.
  400. - *added link* - the symlink was added.
  401. - *removed link* - the symlink was removed.
  402. - *changed link* - the symlink target was changed.
  403. - *mode* - the file/directory/link mode was changed. Note - this could indicate a change from a
  404. file/directory/link type to a different type (file/directory/link), such as -- a file is deleted and replaced
  405. with a directory of the same name.
  406. - *owner* - user and/or group ownership changed.
  407. size:
  408. If **type** == '*added*' or '*removed*', then **size** provides the size of the added or removed file.
  409. added:
  410. If **type** == '*modified*' and chunk ids can be compared, then **added** and **removed** indicate the amount
  411. of data 'added' and 'removed'. If chunk ids can not be compared, then **added** and **removed** properties are
  412. not provided and the only information available is that the file contents were modified.
  413. removed:
  414. See **added** property.
  415. old_mode:
  416. If **type** == '*mode*', then **old_mode** and **new_mode** provide the mode and permissions changes.
  417. new_mode:
  418. See **old_mode** property.
  419. old_user:
  420. If **type** == '*owner*', then **old_user**, **new_user**, **old_group** and **new_group** provide the user
  421. and group ownership changes.
  422. old_group:
  423. See **old_user** property.
  424. new_user:
  425. See **old_user** property.
  426. new_group:
  427. See **old_user** property.
  428. Example (excerpt) of ``borg diff --json-lines``::
  429. {"path": "file1", "changes": [{"path": "file1", "changes": [{"type": "modified", "added": 17, "removed": 5}, {"type": "mode", "old_mode": "-rw-r--r--", "new_mode": "-rwxr-xr-x"}]}]}
  430. {"path": "file2", "changes": [{"type": "modified", "added": 135, "removed": 252}]}
  431. {"path": "file4", "changes": [{"type": "added", "size": 0}]}
  432. {"path": "file3", "changes": [{"type": "removed", "size": 0}]}
  433. .. _msgid:
  434. Message IDs
  435. -----------
  436. Message IDs are strings that essentially give a log message or operation a name, without actually using the
  437. full text, since texts change more frequently. Message IDs are unambiguous and reduce the need to parse
  438. log messages.
  439. Assigned message IDs and related error RCs (exit codes) are:
  440. .. See scripts/errorlist.py; this is slightly edited.
  441. Errors
  442. Error rc: 2 traceback: no
  443. Error: {}
  444. ErrorWithTraceback rc: 2 traceback: yes
  445. Error: {}
  446. Buffer.MemoryLimitExceeded rc: 2 traceback: no
  447. Requested buffer size {} is above the limit of {}.
  448. EfficientCollectionQueue.SizeUnderflow rc: 2 traceback: no
  449. Could not pop_front first {} elements, collection only has {} elements..
  450. RTError rc: 2 traceback: no
  451. Runtime Error: {}
  452. CancelledByUser rc: 3 traceback: no
  453. Cancelled by user.
  454. CommandError rc: 4 traceback: no
  455. Command Error: {}
  456. PlaceholderError rc: 5 traceback: no
  457. Formatting Error: "{}".format({}): {}({})
  458. InvalidPlaceholder rc: 6 traceback: no
  459. Invalid placeholder "{}" in string: {}
  460. Repository.AlreadyExists rc: 10 traceback: no
  461. A repository already exists at {}.
  462. Repository.CheckNeeded rc: 12 traceback: yes
  463. Inconsistency detected. Please run "borg check {}".
  464. Repository.DoesNotExist rc: 13 traceback: no
  465. Repository {} does not exist.
  466. Repository.InsufficientFreeSpaceError rc: 14 traceback: no
  467. Insufficient free space to complete transaction (required: {}, available: {}).
  468. Repository.InvalidRepository rc: 15 traceback: no
  469. {} is not a valid repository. Check repo config.
  470. Repository.InvalidRepositoryConfig rc: 16 traceback: no
  471. {} does not have a valid configuration. Check repo config [{}].
  472. Repository.ObjectNotFound rc: 17 traceback: yes
  473. Object with key {} not found in repository {}.
  474. Repository.ParentPathDoesNotExist rc: 18 traceback: no
  475. The parent path of the repo directory [{}] does not exist.
  476. Repository.PathAlreadyExists rc: 19 traceback: no
  477. There is already something at {}.
  478. Repository.PathPermissionDenied rc: 21 traceback: no
  479. Permission denied to {}.
  480. MandatoryFeatureUnsupported rc: 25 traceback: no
  481. Unsupported repository feature(s) {}. A newer version of borg is required to access this repository.
  482. NoManifestError rc: 26 traceback: no
  483. Repository has no manifest.
  484. UnsupportedManifestError rc: 27 traceback: no
  485. Unsupported manifest envelope. A newer version is required to access this repository.
  486. Archive.AlreadyExists rc: 30 traceback: no
  487. Archive {} already exists
  488. Archive.DoesNotExist rc: 31 traceback: no
  489. Archive {} does not exist
  490. Archive.IncompatibleFilesystemEncodingError rc: 32 traceback: no
  491. Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable.
  492. KeyfileInvalidError rc: 40 traceback: no
  493. Invalid key data for repository {} found in {}.
  494. KeyfileMismatchError rc: 41 traceback: no
  495. Mismatch between repository {} and key file {}.
  496. KeyfileNotFoundError rc: 42 traceback: no
  497. No key file for repository {} found in {}.
  498. NotABorgKeyFile rc: 43 traceback: no
  499. This file is not a borg key backup, aborting.
  500. RepoKeyNotFoundError rc: 44 traceback: no
  501. No key entry found in the config of repository {}.
  502. RepoIdMismatch rc: 45 traceback: no
  503. This key backup seems to be for a different backup repository, aborting.
  504. UnencryptedRepo rc: 46 traceback: no
  505. Key management not available for unencrypted repositories.
  506. UnknownKeyType rc: 47 traceback: no
  507. Key type {0} is unknown.
  508. UnsupportedPayloadError rc: 48 traceback: no
  509. Unsupported payload type {}. A newer version is required to access this repository.
  510. UnsupportedKeyFormatError rc: 49 traceback:no
  511. Your borg key is stored in an unsupported format. Try using a newer version of borg.
  512. NoPassphraseFailure rc: 50 traceback: no
  513. can not acquire a passphrase: {}
  514. PasscommandFailure rc: 51 traceback: no
  515. passcommand supplied in BORG_PASSCOMMAND failed: {}
  516. PassphraseWrong rc: 52 traceback: no
  517. passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.
  518. PasswordRetriesExceeded rc: 53 traceback: no
  519. exceeded the maximum password retries
  520. Cache.CacheInitAbortedError rc: 60 traceback: no
  521. Cache initialization aborted
  522. Cache.EncryptionMethodMismatch rc: 61 traceback: no
  523. Repository encryption method changed since last access, refusing to continue
  524. Cache.RepositoryAccessAborted rc: 62 traceback: no
  525. Repository access aborted
  526. Cache.RepositoryIDNotUnique rc: 63 traceback: no
  527. Cache is newer than repository - do you have multiple, independently updated repos with same ID?
  528. Cache.RepositoryReplay rc: 64 traceback: no
  529. Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)
  530. LockError rc: 70 traceback: no
  531. Failed to acquire the lock {}.
  532. LockErrorT rc: 71 traceback: yes
  533. Failed to acquire the lock {}.
  534. LockFailed rc: 72 traceback: yes
  535. Failed to create/acquire the lock {} ({}).
  536. LockTimeout rc: 73 traceback: no
  537. Failed to create/acquire the lock {} (timeout).
  538. NotLocked rc: 74 traceback: yes
  539. Failed to release the lock {} (was not locked).
  540. NotMyLock rc: 75 traceback: yes
  541. Failed to release the lock {} (was/is locked, but not by me).
  542. ConnectionClosed rc: 80 traceback: no
  543. Connection closed by remote host
  544. ConnectionClosedWithHint rc: 81 traceback: no
  545. Connection closed by remote host. {}
  546. InvalidRPCMethod rc: 82 traceback: no
  547. RPC method {} is not valid
  548. PathNotAllowed rc: 83 traceback: no
  549. Repository path not allowed: {}
  550. RemoteRepository.RPCServerOutdated rc: 84 traceback: no
  551. Borg server is too old for {}. Required version {}
  552. UnexpectedRPCDataFormatFromClient rc: 85 traceback: no
  553. Borg {}: Got unexpected RPC data format from client.
  554. UnexpectedRPCDataFormatFromServer rc: 86 traceback: no
  555. Got unexpected RPC data format from server:
  556. {}
  557. ConnectionBrokenWithHint rc: 87 traceback: no
  558. Connection to remote host is broken. {}
  559. IntegrityError rc: 90 traceback: yes
  560. Data integrity error: {}
  561. FileIntegrityError rc: 91 traceback: yes
  562. File failed integrity check: {}
  563. DecompressionError rc: 92 traceback: yes
  564. Decompression error: {}
  565. Warnings
  566. BorgWarning rc: 1
  567. Warning: {}
  568. BackupWarning rc: 1
  569. {}: {}
  570. FileChangedWarning rc: 100
  571. {}: file changed while we backed it up
  572. IncludePatternNeverMatchedWarning rc: 101
  573. Include pattern '{}' never matched.
  574. BackupError rc: 102
  575. {}: backup error
  576. BackupRaceConditionError rc: 103
  577. {}: file type or inode changed while we backed it up (race condition, skipped file)
  578. BackupOSError rc: 104
  579. {}: {}
  580. BackupPermissionError rc: 105
  581. {}: {}
  582. BackupIOError rc: 106
  583. {}: {}
  584. BackupFileNotFoundError rc: 107
  585. {}: {}
  586. Operations
  587. - cache.begin_transaction
  588. - cache.download_chunks, appears with ``borg create --no-cache-sync``
  589. - cache.commit
  590. - cache.sync
  591. *info* is one string element, the name of the archive currently synced.
  592. - repository.compact_segments
  593. - repository.replay_segments
  594. - repository.check
  595. - check.verify_data
  596. - check.rebuild_manifest
  597. - check.rebuild_refcounts
  598. - extract
  599. *info* is one string element, the name of the path currently extracted.
  600. - extract.permissions
  601. - archive.delete
  602. - archive.calc_stats
  603. - prune
  604. - upgrade.convert_segments
  605. Prompts
  606. BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK
  607. For "Warning: Attempting to access a previously unknown unencrypted repository"
  608. BORG_RELOCATED_REPO_ACCESS_IS_OK
  609. For "Warning: The repository at location ... was previously located at ..."
  610. BORG_CHECK_I_KNOW_WHAT_I_AM_DOING
  611. For "This is a potentially dangerous function..." (check --repair)
  612. BORG_DELETE_I_KNOW_WHAT_I_AM_DOING
  613. For "You requested to DELETE the repository completely *including* all archives it contains:"