Skip to content

Commit

Permalink
docs(restore): add notes from discord about globs and performance
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan committed Feb 10, 2025
1 parent cb15d19 commit a76bb01
Showing 1 changed file with 44 additions and 9 deletions.
53 changes: 44 additions & 9 deletions src/commands/restore/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ enter password for repository:
restoring <Snapshot of [/home/art] at 2015-05-08 21:45:17.884408621 +0200 CEST> to /tmp/restore-art
```

**Note**: When restoring specific paths, it's recommended to use the source path
syntax `latest:/path/to/restore/` followed by the destination path.

For example:

```console
$ rustic restore latest:/home/user/bin/ /home/user/bin/
```

This is more efficient as it only processes the specified subtree in the
snapshot and destination, rather than scanning the entire backup or destination
folder.

<!-- TODO: RESTORE USING GLOB NOT IMPLEMENTED YET
Use `--glob` (pattern to exclude/include (can be specified multiple times)) to
restrict the restore to a subset of files in the snapshot. For example, to
restore a single file:
Expand All @@ -29,19 +44,39 @@ enter password for repository:
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore-work
```
This will restore the file `foo` to `/tmp/restore-work/work/foo`.
This will restore the file `foo` to `/tmp/restore-work/work/foo`. -->

You can use the command `rustic ls latest` to find the path to the file within
the snapshot.

You can use the command `rustic ls latest`
<!-- TODO: or `rustic find foo` (rustic find not implemented yet) -->

<!-- TODO: or `rustic find foo` (rustic find not implemented yet) --> to find
<!-- TODO: RESTORE USING GLOB NOT IMPLEMENTED YET
the path to the file within the snapshot. This path you can then pass to
This path you can then pass to
`--glob` in verbatim to only restore the single file or directory.
There is case insensitive variants of `--glob` called `--iglob`. This option
will behave the same way but ignore the casing of paths.
will behave the same way but ignore the casing of paths. -->

## Important Notes

- Restores the permissions of the files and directories to the state they were
in when the snapshot was taken
- GUIDs and UIDs will be restored as well (this requires elevated privileges to
work correctly)
- The glob pattern feature (`--glob`) is not yet fully implemented for scanning
restrictions
- Always include trailing slashes for directory paths to ensure consistent
behavior
- The source path should be relative to the snapshot's root
- The destination path should be an absolute or relative path on your local
system

## Troubleshooting

If you're experiencing slow restore operations, check if you're:

**Important**: The restore command will restore the permissions of the files and
directories to the state they were in when the snapshot was taken. GUIDs and
UIDs will be restored as well, but this requires elevated privileges to work
correctly.
1. Using glob patterns instead of direct paths
2. Targeting the root directory (/) unnecessarily
3. Missing trailing slashes in your directory paths

0 comments on commit a76bb01

Please sign in to comment.