2017-09-30 20:01:19 +00:00
Manual
======
Usage help
----------
Usage help is available:
.. code-block :: console
$ ./restic --help
2020-11-28 17:38:18 +00:00
2017-09-30 20:01:19 +00:00
restic is a backup program which allows saving multiple revisions of files and
directories in an encrypted repository stored on different backends.
2024-05-25 21:16:22 +00:00
The full documentation can be found at https://restic.readthedocs.io/ .
2017-09-30 20:01:19 +00:00
Usage:
restic [command]
Available Commands:
backup Create a new backup of files and/or directories
2018-05-21 10:06:30 +00:00
cache Operate on local cache directories
2017-09-30 20:01:19 +00:00
cat Print internal objects to stdout
check Check the repository for errors
2020-08-24 21:15:16 +00:00
copy Copy snapshots from one repository to another
2018-04-28 14:19:16 +00:00
diff Show differences between two snapshots
2017-12-04 14:57:00 +00:00
dump Print a backed-up file to stdout
2020-04-03 17:46:30 +00:00
find Find a file, a directory or restic IDs
2017-09-30 20:01:19 +00:00
forget Remove snapshots from the repository
2023-04-30 14:12:29 +00:00
generate Generate manual pages and auto-completion files (bash, fish, zsh, powershell)
2017-09-30 20:01:19 +00:00
help Help about any command
init Initialize a new repository
key Manage keys (passwords)
2017-12-04 14:57:00 +00:00
list List objects in the repository
2017-09-30 20:01:19 +00:00
ls List files in a snapshot
2017-12-04 14:57:00 +00:00
migrate Apply migrations
2017-09-30 20:01:19 +00:00
mount Mount the repository
prune Remove unneeded data from the repository
2022-07-12 18:49:01 +00:00
recover Recover data from the repository not referenced by snapshots
2022-12-27 17:25:39 +00:00
repair Repair the repository
2017-09-30 20:01:19 +00:00
restore Extract the data from a snapshot
2022-10-24 23:01:47 +00:00
rewrite Rewrite snapshots to exclude unwanted files
2020-04-03 17:46:30 +00:00
self-update Update the restic binary
2017-09-30 20:01:19 +00:00
snapshots List all snapshots
2020-04-03 17:46:30 +00:00
stats Scan the repository and show basic statistics
2017-09-30 20:01:19 +00:00
tag Modify tags on snapshots
unlock Remove locks other processes created
version Print version information
Flags:
2024-05-25 21:16:22 +00:00
--cacert file file to load root certificates from (default: use system certificates or $RESTIC_CACERT)
2020-04-03 17:46:30 +00:00
--cache-dir directory set the cache directory. (default: use system default cache directory)
--cleanup-cache auto remove old cache directories
2023-04-23 13:06:11 +00:00
--compression mode compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION) (default auto)
2020-04-03 17:46:30 +00:00
-h, --help help for restic
2024-05-26 22:03:11 +00:00
--http-user-agent value set a custom user agent for outgoing http requests
2024-05-25 21:16:22 +00:00
--insecure-no-password use an empty password for the repository, must be passed to every restic command (insecure)
2022-05-07 20:23:59 +00:00
--insecure-tls skip TLS certificate verification when connecting to the repository (insecure)
2020-04-03 17:46:30 +00:00
--json set output mode to JSON for commands that support it
--key-hint key key ID of key to try decrypting first (default: $RESTIC_KEY_HINT)
2022-08-26 18:44:01 +00:00
--limit-download rate limits downloads to a maximum rate in KiB/s. (default: unlimited)
--limit-upload rate limits uploads to a maximum rate in KiB/s. (default: unlimited)
2020-04-03 17:46:30 +00:00
--no-cache do not use a local cache
2024-05-25 21:16:22 +00:00
--no-extra-verify skip additional verification of data before upload (see documentation)
2020-10-06 20:38:19 +00:00
--no-lock do not lock the repository, this allows some operations on read-only repositories
2020-04-03 17:46:30 +00:00
-o, --option key=value set extended option (key=value, can be specified multiple times)
2022-08-26 18:44:01 +00:00
--pack-size size set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE)
2020-09-19 12:23:25 +00:00
--password-command command shell command to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND)
2020-09-19 13:47:32 +00:00
-p, --password-file file file to read the repository password from (default: $RESTIC_PASSWORD_FILE)
2020-04-03 17:46:30 +00:00
-q, --quiet do not output comprehensive progress report
-r, --repo repository repository to backup to or restore from (default: $RESTIC_REPOSITORY)
2020-09-30 22:14:34 +00:00
--repository-file file file to read the repository location from (default: $RESTIC_REPOSITORY_FILE)
2023-02-16 15:58:36 +00:00
--retry-lock duration retry to lock the repository if it is already locked, takes a value like 5m or 2h (default: no retries)
2024-05-25 21:16:22 +00:00
--tls-client-cert file path to a file containing PEM encoded TLS client certificate and private key (default: $RESTIC_TLS_CLIENT_CERT)
2023-02-06 21:11:21 +00:00
-v, --verbose be verbose (specify multiple times or a level using --verbose=n, max level/times is 2)
2017-09-30 20:01:19 +00:00
Use "restic [command] --help" for more information about a command.
Similar to programs such as `` git `` , restic has a number of
sub-commands. You can see these commands in the listing above. Each
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 ``
command:
.. code-block :: console
$ ./restic backup --help
2020-11-28 17:38:18 +00:00
2017-09-30 20:01:19 +00:00
The "backup" command creates a new snapshot and saves the files and directories
given as the arguments.
2020-04-03 17:46:30 +00:00
EXIT STATUS
===========
2020-08-24 21:16:25 +00:00
Exit status is 0 if the command was successful.
Exit status is 1 if there was a fatal error (no snapshot created).
Exit status is 3 if some source data could not be read (incomplete snapshot created).
2020-04-03 17:46:30 +00:00
2017-09-30 20:01:19 +00:00
Usage:
2022-08-26 18:44:01 +00:00
restic backup [flags] [FILE/DIR] ...
2017-09-30 20:01:19 +00:00
Flags:
2022-07-12 18:49:01 +00:00
-n, --dry-run do not upload or write any data, just show what would be done
2020-04-03 17:46:30 +00:00
-e, --exclude pattern exclude a pattern (can be specified multiple times)
2020-06-21 16:31:59 +00:00
--exclude-caches excludes cache directories that are marked with a CACHEDIR.TAG file. See https://bford.info/cachedir/ for the Cache Directory Tagging Standard
2020-04-03 17:46:30 +00:00
--exclude-file file read exclude patterns from a file (can be specified multiple times)
--exclude-if-present filename[:header] takes filename[:header], exclude contents of directories containing filename (except filename itself) if header of that file is as provided (can be specified multiple times)
2020-09-30 22:15:10 +00:00
--exclude-larger-than size max size of the files to be backed up (allowed suffixes: k/K, m/M, g/G, t/T)
2020-11-28 17:38:18 +00:00
--files-from file read the files to backup from file (can be combined with file args; can be specified multiple times)
--files-from-raw file read the files to backup from file (can be combined with file args; can be specified multiple times)
--files-from-verbatim file read the files to backup from file (can be combined with file args; can be specified multiple times)
2024-05-25 21:16:22 +00:00
-f, --force force re-reading the source files/directories (overrides the "parent" flag)
2023-04-30 14:12:29 +00:00
-g, --group-by group group snapshots by host, paths and/or tags, separated by comma (disable grouping with '') (default host,paths)
2020-04-03 17:46:30 +00:00
-h, --help help for backup
2024-05-25 21:16:22 +00:00
-H, --host hostname set the hostname for the snapshot manually (default: $RESTIC_HOST). To prevent an expensive rescan use the "parent" flag
2020-04-03 17:46:30 +00:00
--iexclude pattern same as --exclude pattern but ignores the casing of filenames
2020-08-25 20:30:57 +00:00
--iexclude-file file same as --exclude-file but ignores casing of filenames in patterns
2022-07-12 18:49:01 +00:00
--ignore-ctime ignore ctime changes when checking for modified files
2024-01-27 12:42:29 +00:00
--ignore-inode ignore inode number and ctime changes when checking for modified files
2023-01-11 01:27:43 +00:00
--no-scan do not run scanner to estimate size of backup
2020-10-08 15:59:26 +00:00
-x, --one-file-system exclude other file systems, don't cross filesystem boundaries and subvolumes
2023-04-30 14:12:29 +00:00
--parent snapshot use this parent snapshot (default: latest snapshot in the group determined by --group-by and not newer than the timestamp determined by --time)
--read-concurrency n read n files concurrently (default: $RESTIC_READ_CONCURRENCY or 2)
2020-04-03 17:46:30 +00:00
--stdin read backup from stdin
--stdin-filename filename filename to use when reading from stdin (default "stdin")
2024-05-25 21:16:22 +00:00
--stdin-from-command interpret arguments as command to execute and store its stdout
2020-11-28 17:38:18 +00:00
--tag tags add tags for the new snapshot in the format `tag[,tag,...]` (can be specified multiple times) (default [])
2020-04-03 17:46:30 +00:00
--time time time of the backup (ex. '2012-11-01 22:08:41') (default: now)
2020-10-24 09:35:57 +00:00
--use-fs-snapshot use filesystem snapshot where possible (currently only Windows VSS)
2020-04-03 17:46:30 +00:00
--with-atime store the atime for all files and directories
2017-09-30 20:01:19 +00:00
Global Flags:
2024-05-25 21:16:22 +00:00
--cacert file file to load root certificates from (default: use system certificates or $RESTIC_CACERT)
2020-04-03 17:46:30 +00:00
--cache-dir directory set the cache directory. (default: use system default cache directory)
--cleanup-cache auto remove old cache directories
2023-04-23 13:06:11 +00:00
--compression mode compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION) (default auto)
2024-05-26 22:03:11 +00:00
--http-user-agent value set a custom user agent for outgoing http requests
2024-05-25 21:16:22 +00:00
--insecure-no-password use an empty password for the repository, must be passed to every restic command (insecure)
2022-05-07 20:23:59 +00:00
--insecure-tls skip TLS certificate verification when connecting to the repository (insecure)
2020-04-03 17:46:30 +00:00
--json set output mode to JSON for commands that support it
--key-hint key key ID of key to try decrypting first (default: $RESTIC_KEY_HINT)
2022-08-26 18:44:01 +00:00
--limit-download rate limits downloads to a maximum rate in KiB/s. (default: unlimited)
--limit-upload rate limits uploads to a maximum rate in KiB/s. (default: unlimited)
2020-04-03 17:46:30 +00:00
--no-cache do not use a local cache
2024-05-25 21:16:22 +00:00
--no-extra-verify skip additional verification of data before upload (see documentation)
2020-10-06 20:38:19 +00:00
--no-lock do not lock the repository, this allows some operations on read-only repositories
2020-04-03 17:46:30 +00:00
-o, --option key=value set extended option (key=value, can be specified multiple times)
2022-08-26 18:44:01 +00:00
--pack-size size set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE)
2020-09-19 12:23:25 +00:00
--password-command command shell command to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND)
2020-09-19 13:47:32 +00:00
-p, --password-file file file to read the repository password from (default: $RESTIC_PASSWORD_FILE)
2020-04-03 17:46:30 +00:00
-q, --quiet do not output comprehensive progress report
-r, --repo repository repository to backup to or restore from (default: $RESTIC_REPOSITORY)
2020-09-30 22:14:34 +00:00
--repository-file file file to read the repository location from (default: $RESTIC_REPOSITORY_FILE)
2023-02-16 15:58:36 +00:00
--retry-lock duration retry to lock the repository if it is already locked, takes a value like 5m or 2h (default: no retries)
2024-05-25 21:16:22 +00:00
--tls-client-cert file path to a file containing PEM encoded TLS client certificate and private key (default: $RESTIC_TLS_CLIENT_CERT)
2023-02-06 21:11:21 +00:00
-v, --verbose be verbose (specify multiple times or a level using --verbose=n, max level/times is 2)
2017-09-30 20:01:19 +00:00
2020-12-28 22:11:42 +00:00
Subcommands that support showing progress information such as `` backup `` ,
2023-11-24 14:29:39 +00:00
`` restore `` , `` check `` and `` prune `` will do so unless the quiet flag `` -q ``
or `` --quiet `` is set. When running from a non-interactive console progress
reporting is disabled by default to not fill your logs. For interactive and
non-interactive consoles the environment variable `` RESTIC_PROGRESS_FPS `` can
be used to control the frequency of progress reporting. Use for example
2020-12-29 14:24:02 +00:00
`` 0.016666 `` to only update the progress once per minute.
2017-09-30 20:01:19 +00:00
2020-12-28 22:11:42 +00:00
Additionally, on Unix systems if `` restic `` receives a SIGUSR1 signal the
2018-03-24 17:49:13 +00:00
current progress will be written to the standard output so you can check up
2017-09-30 20:01:19 +00:00
on the status at will.
2020-12-29 15:03:01 +00:00
Setting the `RESTIC_PROGRESS_FPS` environment variable or sending a `SIGUSR1`
signal prints a status report even when `--quiet` was specified.
2017-09-30 20:01:19 +00:00
Manage tags
-----------
Managing tags on snapshots is done with the `` tag `` command. The
2018-03-24 17:49:13 +00:00
existing set of tags can be replaced completely, tags can be added or
2017-09-30 20:01:19 +00:00
removed. The result is directly visible in the `` snapshots `` command.
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
command does that:
.. code-block :: console
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo tag --set NL --set CH 590c8fc8
2017-10-27 19:06:34 +00:00
create exclusive lock for repository
modified tags on 1 snapshots
2017-09-30 20:01:19 +00:00
2021-07-15 01:38:15 +00:00
Note the snapshot ID has changed, so between each change we need to look up the
new ID of the snapshot. But there is an even better way - the `` tag `` command
accepts a filter using the `` --tag `` option, so we can filter snapshots based
on the tag we just added. This way we can add and remove tags incrementally:
2017-09-30 20:01:19 +00:00
.. code-block :: console
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo tag --tag NL --remove CH
2017-10-27 19:06:34 +00:00
create exclusive lock for repository
modified tags on 1 snapshots
2017-09-30 20:01:19 +00:00
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo tag --tag NL --add UK
2017-10-27 19:06:34 +00:00
create exclusive lock for repository
modified tags on 1 snapshots
2017-09-30 20:01:19 +00:00
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo tag --tag NL --remove NL
2017-10-27 19:06:34 +00:00
create exclusive lock for repository
modified tags on 1 snapshots
2017-09-30 20:01:19 +00:00
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo tag --tag NL --add SOMETHING
2017-10-27 19:06:34 +00:00
no snapshots were modified
2017-09-30 20:01:19 +00:00
2021-07-15 01:38:15 +00:00
To operate on untagged snapshots only, specify the empty string `` '' `` as the
filter value to `` --tag `` . The following command will add the tag `` OTHER ``
to all untagged snapshots:
.. code-block :: console
$ restic -r /srv/restic-repo tag --tag '' --add OTHER
2017-09-30 20:01:19 +00:00
Under the hood
--------------
Browse repository objects
~~~~~~~~~~~~~~~~~~~~~~~~~
Internally, a repository stores data of several different types
described in the `design
2018-08-25 10:30:06 +00:00
documentation <https://github.com/restic/restic/blob/master/doc/design.rst>`__.
2017-09-30 20:01:19 +00:00
You can `` list `` objects such as blobs, packs, index, snapshots, keys or
locks with the following command:
.. code-block :: console
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo list snapshots
2017-09-30 20:01:19 +00:00
d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c
The `` find `` command searches for a given
2023-03-22 16:37:58 +00:00
`pattern <https://pkg.go.dev/path/filepath#Match> `__ in the
2017-09-30 20:01:19 +00:00
repository.
.. code-block :: console
$ restic -r backup find test.txt
debug log file restic.log
debug enabled
enter password for repository:
found 1 matching entries in snapshot 196bc5760c909a7681647949e80e5448e276521489558525680acf1bd428af36
-rw-r--r-- 501 20 5 2015-08-26 14:09:57 +0200 CEST path/to/test.txt
The `` cat `` command allows you to display the JSON representation of the
2018-03-24 17:49:13 +00:00
objects or their raw content.
2017-09-30 20:01:19 +00:00
.. code-block :: console
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo cat snapshot d369ccc7d126594950bf74f0a348d5d98d9e99f3215082eb69bf02dc9b3e464c
2017-09-30 20:01:19 +00:00
enter password for repository:
{
"time": "2015-08-12T12:52:44.091448856+02:00",
"tree": "05cec17e8d3349f402576d02576a2971fc0d9f9776ce2f441c7010849c4ff5af",
"paths": [
"/home/user/work"
],
"hostname": "kasimir",
"username": "username",
"uid": 501,
"gid": 20
}
Metadata handling
~~~~~~~~~~~~~~~~~
Restic saves and restores most default attributes, including extended attributes like ACLs.
2023-01-10 22:09:19 +00:00
Information about holes in a sparse file is not stored explicitly, that is during a backup
the zero bytes in a hole are deduplicated and compressed like any other data backed up.
Instead, the restore command optionally creates holes in files by detecting and replacing
long runs of zeros, in filesystems that support sparse files.
2017-09-30 20:01:19 +00:00
The following metadata is handled by restic:
- Name
- Type
- Mode
- ModTime
- AccessTime
- ChangeTime
- UID
- GID
- User
- Group
- Inode
- Size
- Links
- LinkTarget
- Device
- Content
- Subtree
- ExtendedAttributes
2018-07-27 21:34:37 +00:00
Getting information about repository data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the `` stats `` command to count up stats about the data in the repository.
There are different counting modes available using the `` --mode `` flag,
depending on what you want to calculate. The default is the restore size, or
the size required to restore the files:
- `` restore-size `` (default) counts the size of the restored files.
- `` files-by-contents `` counts the total size of unique files as given by their
contents. This can be useful since a file is considered unique only if it has
unique contents. Keep in mind that a small change to a large file (even when the
file name/path hasn't changed) will cause them to look like different files, thus
essentially causing the whole size of the file to be counted twice.
- `` raw-data `` counts the size of the blobs in the repository, regardless of how many
files reference them. This tells you how much restic has reduced all your original
data down to (either for a single snapshot or across all your backups), and compared
to the size given by the restore-size mode, can tell you how much deduplication is
helping you.
- `` blobs-per-file `` is kind of a mix between files-by-contents and raw-data modes;
it is useful for knowing how much value your backup is providing you in terms of unique
data stored by file. Like files-by-contents, it is resilient to file renames/moves.
Unlike files-by-contents, it does not balloon to high values when large files have
small edits, as long as the file path stayed the same. Unlike raw-data, this mode
DOES consider how many files point to each blob such that the more files a blob is
referenced by, the more it counts toward the size.
For example, to calculate how much space would be
required to restore the latest snapshot (from any host that made it):
.. code-block :: console
$ restic stats latest
Total File Count: 10538
Total Size: 37.824 GiB
If multiple hosts are backing up to the repository, the latest snapshot may not
be the one you want. You can specify the latest snapshot from only a specific
host by using the `` --host `` flag:
.. code-block :: console
$ restic stats --host myserver latest
Total File Count: 21766
Total Size: 481.783 GiB
There we see that it would take 482 GiB of disk space to restore the latest
snapshot from "myserver".
2020-07-31 15:04:04 +00:00
In case you have multiple backups running from the same host so can also use
`` --tag `` and `` --path `` to be more specific about which snapshots you
are looking for.
2018-07-27 21:34:37 +00:00
But how much space does that snapshot take on disk? In other words, how much
has restic's deduplication helped? We can check:
.. code-block :: console
$ restic stats --host myserver --mode raw-data latest
Total Blob Count: 340847
Total Size: 458.663 GiB
Comparing this size to the previous command, we see that restic has saved
about 23 GiB of space with deduplication.
Which mode you use depends on your exact use case. Some modes are more useful
across all snapshots, while others make more sense on just a single snapshot,
depending on what you're trying to calculate.
2017-09-30 20:01:19 +00:00
Scripting
---------
Restic supports the output of some commands in JSON format, the JSON
data can then be processed by other programs (e.g.
`jq <https://stedolan.github.io/jq/> `__ ). The following example
lists all snapshots as JSON and uses `` jq `` to pretty-print the result:
.. code-block :: console
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo snapshots --json | jq .
2017-09-30 20:01:19 +00:00
[
{
"time": "2017-03-11T09:57:43.26630619+01:00",
"tree": "bf25241679533df554fc0fd0ae6dbb9dcf1859a13f2bc9dd4543c354eff6c464",
"paths": [
"/home/work/doc"
],
"hostname": "kasimir",
"username": "fd0",
"uid": 1000,
"gid": 100,
"id": "bbeed6d28159aa384d1ccc6fa0b540644b1b9599b162d2972acda86b1b80f89e"
},
{
"time": "2017-03-11T09:58:57.541446938+01:00",
"tree": "7f8c95d3420baaac28dc51609796ae0e0ecfb4862b609a9f38ffaf7ae2d758da",
"paths": [
"/home/user/shared"
],
"hostname": "kasimir",
"username": "fd0",
"uid": 1000,
"gid": 100,
"id": "b157d91c16f0ba56801ece3a708dfc53791fe2a97e827090d6ed9a69a6ebdca0"
}
]
2020-06-01 09:58:21 +00:00
.. _temporary_files:
2017-09-30 20:01:19 +00:00
Temporary files
---------------
During some operations (e.g. `` backup `` and `` prune `` ) restic uses
temporary files to store data. These files will, by default, be saved to
the system's temporary directory, on Linux this is usually located in
2024-05-20 18:48:29 +00:00
`` /tmp/ `` . To specify a different directory for temporary files, set
the appropriate environment variable. On non-Windows operating systems,
use the `` TMPDIR `` environment variable. On Windows, use either the
`` TMP `` or `` TEMP `` environment variable. For example, to use the
directory `` /var/tmp/restic-tmp `` instead of the default, set the
environment variable as follows:
2017-09-30 20:01:19 +00:00
.. code-block :: console
$ export TMPDIR=/var/tmp/restic-tmp
2018-04-28 14:19:16 +00:00
$ restic -r /srv/restic-repo backup ~/work
2017-09-30 20:01:19 +00:00
2020-06-01 09:58:21 +00:00
.. _caching:
2017-09-30 20:01:19 +00:00
Caching
-------
Restic keeps a cache with some files from the repository on the local machine.
This allows faster operations, since meta data does not need to be loaded from
2017-10-03 03:15:37 +00:00
a remote repository. The cache is automatically created, usually in an
OS-specific cache folder:
2024-01-23 18:01:22 +00:00
* Linux/other: `` $XDG_CACHE_HOME/restic `` , or `` ~/.cache/restic `` if
`` XDG_CACHE_HOME `` is not set
* macOS: `` ~/Library/Caches/restic ``
* Windows: `` %LOCALAPPDATA%/restic ``
2017-10-03 03:15:37 +00:00
2020-10-07 15:13:29 +00:00
If the relevant environment variables are not set, restic exits with an error
message.
2019-09-26 22:48:52 +00:00
The command line parameter `` --cache-dir `` or the environment variable
`` $RESTIC_CACHE_DIR `` can be used to override the default cache location. The
parameter `` --no-cache `` disables the cache entirely. In this case, all data
2022-07-12 18:48:01 +00:00
is loaded from the repository.
2017-09-30 20:01:19 +00:00
2023-06-17 13:45:54 +00:00
If a cache location is explicitly specified, then the `` check `` command will use
that location to store its temporary cache. See :ref: `checking-integrity` for
more details.
2017-09-30 20:01:19 +00:00
The cache is ephemeral: When a file cannot be read from the cache, it is loaded
from the repository.
2017-11-25 10:28:59 +00:00
Within the cache directory, there's a sub directory for each repository the
2022-05-07 20:23:59 +00:00
cache was used with. Restic updates the timestamps of a repository directory each
2017-11-25 10:28:59 +00:00
time it is used, so by looking at the timestamps of the sub directories of the
cache directory it can decide which sub directories are old and probably not
needed any more. You can either remove these directories manually, or run a
restic command with the `` --cleanup-cache `` flag.