|
@@ -96,6 +96,8 @@ log_message
|
|
|
:ref:`msgid <msgid>`
|
|
|
Message ID, may be *none* or absent
|
|
|
|
|
|
+See Prompts_ for the types used by prompts.
|
|
|
+
|
|
|
.. rubric:: Examples (reformatted, each object would be on exactly one line)
|
|
|
|
|
|
:ref:`borg_extract` progress::
|
|
@@ -129,10 +131,78 @@ A debug log message::
|
|
|
{"message": "35 self tests completed in 0.08 seconds",
|
|
|
"type": "log_message", "created": 1488278449.5575905, "levelname": "DEBUG", "name": "borg.archiver"}
|
|
|
|
|
|
+Prompts
|
|
|
+-------
|
|
|
+
|
|
|
+Prompts assume a JSON form as well when the ``--log-json`` option is specified. Responses
|
|
|
+are still read verbatim from *stdin*, while prompts are JSON messages printed to *stderr*,
|
|
|
+just like log messages.
|
|
|
+
|
|
|
+Prompts use the *question_prompt*, *question_prompt_retry*, *question_invalid_answer*,
|
|
|
+*question_accepted_default*, *question_accepted_true*, *question_accepted_false* and
|
|
|
+*question_env_answer* types.
|
|
|
+
|
|
|
+The *message* property contains the same string displayed regularly in the same situation,
|
|
|
+while the *msgid* property may contain a msgid_, typically the name of the
|
|
|
+environment variable that can be used to override the prompt. It is the same for all JSON
|
|
|
+messages pertaining to the same prompt.
|
|
|
+
|
|
|
+The *is_prompt* boolean property distinguishes informational messages from prompts, it
|
|
|
+is true for *question_prompt* and *question_prompt_retry* types, otherwise it is false.
|
|
|
+
|
|
|
+.. rubric:: Examples (reformatted, each object would be on exactly one line)
|
|
|
+
|
|
|
+Providing an invalid answer::
|
|
|
+
|
|
|
+ {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": true,
|
|
|
+ "message": "... Type 'YES' if you understand this and want to continue: "}
|
|
|
+ incorrect answer # input on stdin
|
|
|
+ {"type": "question_invalid_answer", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": false,
|
|
|
+ "message": "Invalid answer, aborting."}
|
|
|
+
|
|
|
+Providing a false (negative) answer::
|
|
|
+
|
|
|
+ {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": true,
|
|
|
+ "message": "... Type 'YES' if you understand this and want to continue: "}
|
|
|
+ NO # input on stdin
|
|
|
+ {"type": "question_accepted_false", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING",
|
|
|
+ "message": "Aborting.", "is_prompt": false}
|
|
|
+
|
|
|
+Providing a true (affirmative) answer::
|
|
|
+
|
|
|
+ {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": true,
|
|
|
+ "message": "... Type 'YES' if you understand this and want to continue: "}
|
|
|
+ YES # input on stdin
|
|
|
+ # no further output, just like the prompt without --log-json
|
|
|
+
|
|
|
+Passphrase prompts
|
|
|
+------------------
|
|
|
+
|
|
|
+Passphrase prompts should be handled differently. Use the environment variables *BORG_PASSPHRASE*
|
|
|
+and *BORG_NEW_PASSPHRASE* (see :ref:`env_vars` for reference) to pass passphrases to Borg, don't
|
|
|
+use the interactive passphrase prompts.
|
|
|
+
|
|
|
+When setting a new passphrase (:ref:`borg_init`, :ref:`borg_key_change-passphrase`) normally
|
|
|
+Borg prompts whether it should display the passphrase. This can be suppressed by setting
|
|
|
+the environment variable *BORG_DISPLAY_PASSPHRASE* to *no*.
|
|
|
+
|
|
|
+When "confronted" with an unknown repository, where the application does not know whether
|
|
|
+the repository is encrypted, the following algorithm can be followed to detect encryption:
|
|
|
+
|
|
|
+1. Set *BORG_PASSPHRASE* to gibberish (for example a freshly generated UUID4, which cannot
|
|
|
+ possibly be the passphrase)
|
|
|
+2. Invoke ``borg list repository ...``
|
|
|
+3. If this fails, due the repository being encrypted and the passphrase obviously being
|
|
|
+ wrong, you'll get an error with the *PassphraseWrong* msgid.
|
|
|
+
|
|
|
+ The repository is encrypted, for further access the application will need the passphrase.
|
|
|
+
|
|
|
+4. If this does not fail, then the repository is not encrypted.
|
|
|
+
|
|
|
Standard output
|
|
|
---------------
|
|
|
|
|
|
-*stdout* is different and more command-dependent. Commands like :ref:`borg_info`, :ref:`borg_create`
|
|
|
+*stdout* is different and more command-dependent than logging. Commands like :ref:`borg_info`, :ref:`borg_create`
|
|
|
and :ref:`borg_list` implement a ``--json`` option which turns their regular output into a single JSON object.
|
|
|
|
|
|
Dates are formatted according to ISO-8601 with the strftime format string '%a, %Y-%m-%d %H:%M:%S',
|
|
@@ -461,3 +531,15 @@ Operations
|
|
|
*info* is one string element, the name of the path currently extracted.
|
|
|
- extract.permissions
|
|
|
- archive.delete
|
|
|
+
|
|
|
+Prompts
|
|
|
+ BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK
|
|
|
+ For "Warning: Attempting to access a previously unknown unencrypted repository"
|
|
|
+ BORG_RELOCATED_REPO_ACCESS_IS_OK
|
|
|
+ For "Warning: The repository at location ... was previously located at ..."
|
|
|
+ BORG_CHECK_I_KNOW_WHAT_I_AM_DOING
|
|
|
+ For "Warning: 'check --repair' is an experimental feature that might result in data loss."
|
|
|
+ BORG_DELETE_I_KNOW_WHAT_I_AM_DOING
|
|
|
+ For "You requested to completely DELETE the repository *including* all archives it contains:"
|
|
|
+ BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING
|
|
|
+ For "recreate is an experimental feature."
|