doc: Describe linktarget_raw field

This commit is contained in:
Michael Eischer 2023-07-25 20:14:47 +02:00
parent 98fb56baa6
commit 647ebf352a
1 changed files with 33 additions and 0 deletions

View File

@ -548,6 +548,39 @@ This tree contains a file entry. This time, the ``subtree`` field is not
present and the ``content`` field contains a list with one plain text
SHA-256 hash.
A symlink uses the following data structure:
.. code-block:: console
$ restic -r /tmp/restic-repo cat blob 4c0a7d500bd1482ba01752e77c8d5a923304777d96b6522fae7c11e99b4e6fa6 | jq .
enter password for repository:
{
"nodes": [
{
"name": "testlink",
"type": "symlink",
"mode": 134218239,
"mtime": "2023-07-25T20:01:44.007465374+02:00",
"atime": "2023-07-25T20:01:44.007465374+02:00",
"ctime": "2023-07-25T20:01:44.007465374+02:00",
"uid": 1000,
"gid": 100,
"user": "fd0",
"inode": 33734827,
"links": 1,
"linktarget": "example_target",
"content": null
},
[...]
]
}
The symlink target is stored in the field `linktarget`. As JSON strings can
only contain valid unicode, an exception applies if the `linktarget` is not a
valid UTF-8 string. Since restic 0.16.0, in such a case the `linktarget_raw`
field contains a base64 encoded version of the raw linktarget. The
`linktarget_raw` field is only set if `linktarget` cannot be encoded correctly.
The command ``restic cat blob`` can also be used to extract and decrypt
data given a plaintext ID, e.g. for the data mentioned above: