2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-01 17:23:57 +00:00

doc: Use "code-block console" for session blocks

This commit is contained in:
Alexander Neumann 2017-04-17 22:43:04 +02:00
parent 085b6bede8
commit 407b8c179b
3 changed files with 59 additions and 59 deletions

View File

@ -113,7 +113,7 @@ backend is shown here:
A local repository can be initialized with the ``restic init`` command, A local repository can be initialized with the ``restic init`` command,
e.g.: e.g.:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo init $ restic -r /tmp/restic-repo init
@ -351,7 +351,7 @@ this repository (encoded in Base64). The command
``restic cat masterkey`` can be used as follows to decrypt and ``restic cat masterkey`` can be used as follows to decrypt and
pretty-print the master key: pretty-print the master key:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat masterkey $ restic -r /tmp/restic-repo cat masterkey
{ {
@ -384,7 +384,7 @@ uniquely identify a snapshot.
The command ``restic cat snapshot`` can be used as follows to decrypt The command ``restic cat snapshot`` can be used as follows to decrypt
and pretty-print the contents of a snapshot file: and pretty-print the contents of a snapshot file:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat snapshot 251c2e58 $ restic -r /tmp/restic-repo cat snapshot 251c2e58
enter password for repository: enter password for repository:
@ -410,7 +410,7 @@ order to relate these seemingly different snapshots, a field
snapshot, e.g. after adding the tag ``DE`` to the snapshot above it snapshot, e.g. after adding the tag ``DE`` to the snapshot above it
becomes: becomes:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat snapshot 22a5af1b $ restic -r /tmp/restic-repo cat snapshot 22a5af1b
enter password for repository: enter password for repository:
@ -452,7 +452,7 @@ The command ``restic cat blob`` can be used to inspect the tree
referenced above (piping the output of the command to ``jq .`` so that referenced above (piping the output of the command to ``jq .`` so that
the JSON is indented): the JSON is indented):
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat blob b8138ab08a4722596ac89c917827358da4672eac68e3c03a8115b88dbf4bfb59 | jq . $ restic -r /tmp/restic-repo cat blob b8138ab08a4722596ac89c917827358da4672eac68e3c03a8115b88dbf4bfb59 | jq .
enter password for repository: enter password for repository:
@ -483,7 +483,7 @@ tree object.
When the command ``restic cat blob`` is used, the plaintext ID is needed When the command ``restic cat blob`` is used, the plaintext ID is needed
to print a tree. The tree referenced above can be dumped as follows: to print a tree. The tree referenced above can be dumped as follows:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat blob 8b238c8811cc362693e91a857460c78d3acf7d9edb2f111048691976803cf16e $ restic -r /tmp/restic-repo cat blob 8b238c8811cc362693e91a857460c78d3acf7d9edb2f111048691976803cf16e
enter password for repository: enter password for repository:
@ -517,7 +517,7 @@ SHA-256 hash.
The command ``restic cat blob`` can also be used to extract and decrypt 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: data given a plaintext ID, e.g. for the data mentioned above:
.. code:: console .. code-block:: console
$ restic -r /tmp/restic-repo cat blob 50f77b3b4291e8411a027b9f9b9e64658181cc676ce6ba9958b95f268cb1109d | sha256sum $ restic -r /tmp/restic-repo cat blob 50f77b3b4291e8411a027b9f9b9e64658181cc676ce6ba9958b95f268cb1109d | sha256sum
enter password for repository: enter password for repository:

View File

@ -10,7 +10,7 @@ Mac OS X
If you are using Mac OS X, you can install restic using the If you are using Mac OS X, you can install restic using the
`homebrew <http://brew.sh/>`__ packet manager: `homebrew <http://brew.sh/>`__ packet manager:
.. code:: console .. code-block:: console
$ brew tap restic/restic $ brew tap restic/restic
$ brew install restic $ brew install restic
@ -21,7 +21,7 @@ archlinux
On archlinux, there is a package called ``restic-git`` which can be On archlinux, there is a package called ``restic-git`` which can be
installed from AUR, e.g. with ``pacaur``: installed from AUR, e.g. with ``pacaur``:
.. code:: console .. code-block:: console
$ pacaur -S restic-git $ pacaur -S restic-git
@ -42,7 +42,7 @@ instructions how to install Go.
In order to build restic from source, execute the following steps: In order to build restic from source, execute the following steps:
.. code:: console .. code-block:: console
$ git clone https://github.com/restic/restic $ git clone https://github.com/restic/restic
[...] [...]

View File

@ -6,7 +6,7 @@ Usage help
Usage help is available: Usage help is available:
.. code:: console .. code-block:: console
$ ./restic --help $ ./restic --help
restic is a backup program which allows saving multiple revisions of files and restic is a backup program which allows saving multiple revisions of files and
@ -49,7 +49,7 @@ sub-command may have own command-line options, and there is a help
option for each command which lists them, e.g. for the ``backup`` option for each command which lists them, e.g. for the ``backup``
command: command:
.. code:: console .. code-block:: console
$ ./restic backup --help $ ./restic backup --help
The "backup" command creates a new snapshot and saves the files and directories The "backup" command creates a new snapshot and saves the files and directories
@ -98,7 +98,7 @@ Local
In order to create a repository at ``/tmp/backup``, run the following In order to create a repository at ``/tmp/backup``, run the following
command and enter the same password twice: command and enter the same password twice:
.. code:: console .. code-block:: console
$ restic init --repo /tmp/backup $ restic init --repo /tmp/backup
enter password for new backend: enter password for new backend:
@ -129,7 +129,7 @@ prompts for credentials.
Once the server is configured, the setup of the SFTP repository can Once the server is configured, the setup of the SFTP repository can
simply be achieved by changing the URL scheme in the ``init`` command: simply be achieved by changing the URL scheme in the ``init`` command:
.. code:: console .. code-block:: console
$ restic -r sftp:user@host:/tmp/backup init $ restic -r sftp:user@host:/tmp/backup init
enter password for new backend: enter password for new backend:
@ -190,7 +190,7 @@ server <https://github.com/restic/rest-server>`__ instance. Once the
server is configured, accessing it is achieved by changing the URL server is configured, accessing it is achieved by changing the URL
scheme like this: scheme like this:
.. code:: console .. code-block:: console
$ restic -r rest:http://host:8000/ $ restic -r rest:http://host:8000/
@ -199,7 +199,7 @@ password protection, or multiple repositories. Or any combination of
those features, as you see fit. TCP/IP port is also configurable. Here those features, as you see fit. TCP/IP port is also configurable. Here
are some more examples: are some more examples:
.. code:: console .. code-block:: console
$ restic -r rest:https://host:8000/ $ restic -r rest:https://host:8000/
$ restic -r rest:https://user:pass@host:8000/ $ restic -r rest:https://user:pass@host:8000/
@ -223,7 +223,7 @@ credentials to sign HTTP requests. By consequence, you must first setup
the following environment variables with the credentials you obtained the following environment variables with the credentials you obtained
while creating the bucket. while creating the bucket.
.. code:: console .. code-block:: console
$ export AWS_ACCESS_KEY_ID=<MY_ACCESS_KEY> $ export AWS_ACCESS_KEY_ID=<MY_ACCESS_KEY>
$ export AWS_SECRET_ACCESS_KEY=<MY_SECRET_ACCESS_KEY> $ export AWS_SECRET_ACCESS_KEY=<MY_SECRET_ACCESS_KEY>
@ -232,7 +232,7 @@ You can then easily initialize a repository that uses your Amazon S3 as
a backend, if the bucket does not exist yet it will be created in the a backend, if the bucket does not exist yet it will be created in the
default location: default location:
.. code:: console .. code-block:: console
$ restic -r s3:s3.amazonaws.com/bucket_name init $ restic -r s3:s3.amazonaws.com/bucket_name init
enter password for new backend: enter password for new backend:
@ -264,7 +264,7 @@ written in Go and compatible with AWS S3 API.
You must first setup the following environment variables with the You must first setup the following environment variables with the
credentials of your running Minio Server. credentials of your running Minio Server.
.. code:: console .. code-block:: console
$ export AWS_ACCESS_KEY_ID=<YOUR-MINIO-ACCESS-KEY-ID> $ export AWS_ACCESS_KEY_ID=<YOUR-MINIO-ACCESS-KEY-ID>
$ export AWS_SECRET_ACCESS_KEY= <YOUR-MINIO-SECRET-ACCESS-KEY> $ export AWS_SECRET_ACCESS_KEY= <YOUR-MINIO-SECRET-ACCESS-KEY>
@ -272,7 +272,7 @@ credentials of your running Minio Server.
Now you can easily initialize restic to use Minio server as backend with Now you can easily initialize restic to use Minio server as backend with
this command. this command.
.. code:: console .. code-block:: console
$ ./restic -r s3:http://localhost:9000/restic init $ ./restic -r s3:http://localhost:9000/restic init
enter password for new backend: enter password for new backend:
@ -295,7 +295,7 @@ You can workaround this by using a special tool called ``winpty`` (look
`here <https://github.com/rprichard/winpty>`__ for detail information). `here <https://github.com/rprichard/winpty>`__ for detail information).
On MSYS2, you can install ``winpty`` as follows: On MSYS2, you can install ``winpty`` as follows:
.. code:: console .. code-block:: console
$ pacman -S winpty $ pacman -S winpty
$ winpty restic -r /tmp/backup init $ winpty restic -r /tmp/backup init
@ -308,7 +308,7 @@ specific point in time is called a "snapshot" in restic. Run the
following command and enter the repository password you chose above following command and enter the repository password you chose above
again: again:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup ~/work $ restic -r /tmp/backup backup ~/work
enter password for repository: enter password for repository:
@ -326,7 +326,7 @@ If you run the command again, restic will create another snapshot of
your data, but this time it's even faster. This is de-duplication at your data, but this time it's even faster. This is de-duplication at
work! work!
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup ~/shared/work/web $ restic -r /tmp/backup backup ~/shared/work/web
enter password for repository: enter password for repository:
@ -339,7 +339,7 @@ work!
You can even backup individual files in the same repository. You can even backup individual files in the same repository.
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup ~/work.txt $ restic -r /tmp/backup backup ~/work.txt
scan [~/work.txt] scan [~/work.txt]
@ -363,7 +363,7 @@ decided based on the modify date of the file in the file system.
You can exclude folders and files by specifying exclude-patterns. Either You can exclude folders and files by specifying exclude-patterns. Either
specify them with multiple ``--exclude``'s or one ``--exclude-file`` specify them with multiple ``--exclude``'s or one ``--exclude-file``
.. code:: console .. code-block:: console
$ cat exclude $ cat exclude
# exclude go-files # exclude go-files
@ -385,7 +385,7 @@ to only backup files from the file systems the initially specified files
or directories reside on. For example, calling restic like this won't or directories reside on. For example, calling restic like this won't
backup ``/sys`` or ``/dev`` on a Linux system: backup ``/sys`` or ``/dev`` on a Linux system:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup --one-file-system / $ restic -r /tmp/backup backup --one-file-system /
@ -397,20 +397,20 @@ by other software.
For example maybe you want to backup files that have a certain filename For example maybe you want to backup files that have a certain filename
in them: in them:
.. code:: console .. code-block:: console
$ find /tmp/somefiles | grep 'PATTERN' > /tmp/files_to_backup $ find /tmp/somefiles | grep 'PATTERN' > /tmp/files_to_backup
You can then use restic to backup the filtered files: You can then use restic to backup the filtered files:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup --files-from /tmp/files_to_backup $ restic -r /tmp/backup backup --files-from /tmp/files_to_backup
Incidentally you can also combine ``--files-from`` with the normal files Incidentally you can also combine ``--files-from`` with the normal files
args: args:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup --files-from /tmp/files_to_backup /tmp/some_additional_file $ restic -r /tmp/backup backup --files-from /tmp/files_to_backup /tmp/some_additional_file
@ -422,7 +422,7 @@ Sometimes it can be nice to directly save the output of a program, e.g.
this mode of operation, just supply the option ``--stdin`` to the this mode of operation, just supply the option ``--stdin`` to the
``backup`` command like this: ``backup`` command like this:
.. code:: console .. code-block:: console
$ mysqldump [...] | restic -r /tmp/backup backup --stdin $ mysqldump [...] | restic -r /tmp/backup backup --stdin
@ -433,7 +433,7 @@ and read the file.
By default, the file name ``stdin`` is used, a different name can be By default, the file name ``stdin`` is used, a different name can be
specified with ``--stdin-filename``, e.g. like this: specified with ``--stdin-filename``, e.g. like this:
.. code:: console .. code-block:: console
$ mysqldump [...] | restic -r /tmp/backup backup --stdin --stdin-filename production.sql $ mysqldump [...] | restic -r /tmp/backup backup --stdin --stdin-filename production.sql
@ -443,7 +443,7 @@ Tags
Snapshots can have one or more tags, short strings which add identifying Snapshots can have one or more tags, short strings which add identifying
information. Just specify the tags for a snapshot with ``--tag``: information. Just specify the tags for a snapshot with ``--tag``:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup backup --tag projectX ~/shared/work/web $ restic -r /tmp/backup backup --tag projectX ~/shared/work/web
[...] [...]
@ -455,7 +455,7 @@ List all snapshots
Now, you can list all the snapshots stored in the repository: Now, you can list all the snapshots stored in the repository:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots $ restic -r /tmp/backup snapshots
enter password for repository: enter password for repository:
@ -469,7 +469,7 @@ Now, you can list all the snapshots stored in the repository:
You can filter the listing by directory path: You can filter the listing by directory path:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots --path="/srv" $ restic -r /tmp/backup snapshots --path="/srv"
enter password for repository: enter password for repository:
@ -480,7 +480,7 @@ You can filter the listing by directory path:
Or filter by host: Or filter by host:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots --host luigi $ restic -r /tmp/backup snapshots --host luigi
enter password for repository: enter password for repository:
@ -498,7 +498,7 @@ Restoring a snapshot is as easy as it sounds, just use the following
command to restore the contents of the latest snapshot to command to restore the contents of the latest snapshot to
``/tmp/restore-work``: ``/tmp/restore-work``:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup restore 79766175 --target ~/tmp/restore-work $ restic -r /tmp/backup restore 79766175 --target ~/tmp/restore-work
enter password for repository: enter password for repository:
@ -508,7 +508,7 @@ Use the word ``latest`` to restore the last backup. You can also combine
``latest`` with the ``--host`` and ``--path`` filters to choose the last ``latest`` with the ``--host`` and ``--path`` filters to choose the last
backup for a specific host, path or both. backup for a specific host, path or both.
.. code:: console .. code-block:: console
$ restic -r /tmp/backup restore latest --target ~/tmp/restore-work --path "/home/art" --host luigi $ restic -r /tmp/backup restore latest --target ~/tmp/restore-work --path "/home/art" --host luigi
enter password for repository: enter password for repository:
@ -521,7 +521,7 @@ The ``key`` command allows you to set multiple access keys or passwords
per repository. In fact, you can use the ``list``, ``add``, ``remove`` per repository. In fact, you can use the ``list``, ``add``, ``remove``
and ``passwd`` sub-commands to manage these keys very precisely: and ``passwd`` sub-commands to manage these keys very precisely:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup key list $ restic -r /tmp/backup key list
enter password for repository: enter password for repository:
@ -553,7 +553,7 @@ Let's say we want to tag snapshot ``590c8fc8`` with the tags ``NL`` and
``CH`` and remove all other tags that may be present, the following ``CH`` and remove all other tags that may be present, the following
command does that: command does that:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup tag --set NL,CH 590c8fc8 $ restic -r /tmp/backup tag --set NL,CH 590c8fc8
Create exclusive lock for repository Create exclusive lock for repository
@ -566,7 +566,7 @@ snapshots based on the tag we just added.
So we can add and remove tags incrementally like this: So we can add and remove tags incrementally like this:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup tag --tag NL --remove CH $ restic -r /tmp/backup tag --tag NL --remove CH
Create exclusive lock for repository Create exclusive lock for repository
@ -590,7 +590,7 @@ Imagine your repository is saved on a server that has a faulty hard
drive, or even worse, attackers get privileged access and modify your drive, or even worse, attackers get privileged access and modify your
backup with the intention to make you restore malicious data: backup with the intention to make you restore malicious data:
.. code:: console .. code-block:: console
$ sudo echo "boom" >> backup/index/d795ffa99a8ab8f8e42cec1f814df4e48b8f49129360fb57613df93739faee97 $ sudo echo "boom" >> backup/index/d795ffa99a8ab8f8e42cec1f814df4e48b8f49129360fb57613df93739faee97
@ -598,7 +598,7 @@ In order to detect these things, it is a good idea to regularly use the
``check`` command to test whether everything is alright, your precious ``check`` command to test whether everything is alright, your precious
backup data is consistent and the integrity is unharmed: backup data is consistent and the integrity is unharmed:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup check $ restic -r /tmp/backup check
Load indexes Load indexes
@ -607,7 +607,7 @@ backup data is consistent and the integrity is unharmed:
Trying to restore a snapshot which has been modified as shown above will Trying to restore a snapshot which has been modified as shown above will
yield the same error: yield the same error:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup restore 79766175 --target ~/tmp/restore-work $ restic -r /tmp/backup restore 79766175 --target ~/tmp/restore-work
Load indexes Load indexes
@ -620,7 +620,7 @@ Browsing your backup as a regular file system is also very easy. First,
create a mount point such as ``/mnt/restic`` and then use the following create a mount point such as ``/mnt/restic`` and then use the following
command to serve the repository with FUSE: command to serve the repository with FUSE:
.. code:: console .. code-block:: console
$ mkdir /mnt/restic $ mkdir /mnt/restic
$ restic -r /tmp/backup mount /mnt/restic $ restic -r /tmp/backup mount /mnt/restic
@ -654,7 +654,7 @@ Remove a single snapshot
The command ``snapshots`` can be used to list all snapshots in a The command ``snapshots`` can be used to list all snapshots in a
repository like this: repository like this:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots $ restic -r /tmp/backup snapshots
enter password for repository: enter password for repository:
@ -669,7 +669,7 @@ repository like this:
In order to remove the snapshot of ``/home/art``, use the ``forget`` In order to remove the snapshot of ``/home/art``, use the ``forget``
command and specify the snapshot ID on the command line: command and specify the snapshot ID on the command line:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup forget bdbd3439 $ restic -r /tmp/backup forget bdbd3439
enter password for repository: enter password for repository:
@ -677,7 +677,7 @@ command and specify the snapshot ID on the command line:
Afterwards this snapshot is removed: Afterwards this snapshot is removed:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots $ restic -r /tmp/backup snapshots
enter password for repository: enter password for repository:
@ -692,7 +692,7 @@ But the data that was referenced by files in this snapshot is still
stored in the repository. To cleanup unreferenced data, the ``prune`` stored in the repository. To cleanup unreferenced data, the ``prune``
command must be run: command must be run:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup prune $ restic -r /tmp/backup prune
enter password for repository: enter password for repository:
@ -717,7 +717,7 @@ Afterwards the repository is smaller.
You can automate this two-step process by using the ``--prune`` switch You can automate this two-step process by using the ``--prune`` switch
to ``forget``: to ``forget``:
.. code:: console .. code-block:: console
$ restic forget --keep-last 1 --prune $ restic forget --keep-last 1 --prune
snapshots for host mopped, directories /home/user/work: snapshots for host mopped, directories /home/user/work:
@ -802,14 +802,14 @@ Debugging
The program can be built with debug support like this: The program can be built with debug support like this:
.. code:: console .. code-block:: console
$ go run build.go -tags debug $ go run build.go -tags debug
Afterwards, extensive debug messages are written to the file in Afterwards, extensive debug messages are written to the file in
environment variable ``DEBUG_LOG``, e.g.: environment variable ``DEBUG_LOG``, e.g.:
.. code:: console .. code-block:: console
$ DEBUG_LOG=/tmp/restic-debug.log restic backup ~/work $ DEBUG_LOG=/tmp/restic-debug.log restic backup ~/work
@ -828,7 +828,7 @@ patterns are separated by commas. Patterns are case sensitive.
Printing all log messages to the console can be achieved by setting the Printing all log messages to the console can be achieved by setting the
file filter to ``*``: file filter to ``*``:
.. code:: console .. code-block:: console
$ DEBUG_FILES=* restic check $ DEBUG_FILES=* restic check
@ -836,7 +836,7 @@ If you want restic to just print all debug log messages from the files
``main.go`` and ``lock.go``, set the environment variable ``main.go`` and ``lock.go``, set the environment variable
``DEBUG_FILES`` like this: ``DEBUG_FILES`` like this:
.. code:: console .. code-block:: console
$ DEBUG_FILES=main.go,lock.go restic check $ DEBUG_FILES=main.go,lock.go restic check
@ -844,7 +844,7 @@ The following command line instructs restic to only print debug
statements originating in functions that match the pattern ``*unlock*`` statements originating in functions that match the pattern ``*unlock*``
(case sensitive): (case sensitive):
.. code:: console .. code-block:: console
$ DEBUG_FUNCS=*unlock* restic check $ DEBUG_FUNCS=*unlock* restic check
@ -857,7 +857,7 @@ documentation <https://github.com/restic/restic/blob/master/doc/Design.md>`__.
You can ``list`` objects such as blobs, packs, index, snapshots, keys or You can ``list`` objects such as blobs, packs, index, snapshots, keys or
locks with the following command: locks with the following command:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup list snapshots $ restic -r /tmp/backup list snapshots
d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c
@ -866,7 +866,7 @@ The ``find`` command searches for a given
`pattern <http://golang.org/pkg/path/filepath/#Match>`__ in the `pattern <http://golang.org/pkg/path/filepath/#Match>`__ in the
repository. repository.
.. code:: console .. code-block:: console
$ restic -r backup find test.txt $ restic -r backup find test.txt
debug log file restic.log debug log file restic.log
@ -878,7 +878,7 @@ repository.
The ``cat`` command allows you to display the JSON representation of the The ``cat`` command allows you to display the JSON representation of the
objects or its raw content. objects or its raw content.
.. code:: console .. code-block:: console
$ restic -r /tmp/backup cat snapshot d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c $ restic -r /tmp/backup cat snapshot d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c
enter password for repository: enter password for repository:
@ -902,7 +902,7 @@ data can then be processed by other programs (e.g.
`jq <https://stedolan.github.io/jq/>`__). The following example `jq <https://stedolan.github.io/jq/>`__). The following example
lists all snapshots as JSON and uses ``jq`` to pretty-print the result: lists all snapshots as JSON and uses ``jq`` to pretty-print the result:
.. code:: console .. code-block:: console
$ restic -r /tmp/backup snapshots --json | jq . $ restic -r /tmp/backup snapshots --json | jq .
[ [
@ -942,7 +942,7 @@ the system's temporary directory, on Linux this is usually located in
different directory, e.g. to use the directory ``/var/tmp/restic-tmp`` different directory, e.g. to use the directory ``/var/tmp/restic-tmp``
instead of the default, set the environment variable like this: instead of the default, set the environment variable like this:
.. code:: console .. code-block:: console
$ export TMPDIR=/var/tmp/restic-tmp $ export TMPDIR=/var/tmp/restic-tmp
$ restic -r /tmp/backup backup ~/work $ restic -r /tmp/backup backup ~/work