Skip to content

Commit

Permalink
update docu about mount and webdav
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome committed Dec 7, 2024
1 parent 0c7ab5b commit 3aa6e50
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- [Hooks](./commands/misc/hooks.md)
- [Restoring data from backups](./commands/restore/intro.md)
- [Using mount](./commands/restore/using_mount.md)
- [Using webdav](./commands/restore/webdav.md)
- [Printing files to StdOut](./commands/restore/printing_stdout.md)
- [Removing backup snapshots](./commands/forget/intro.md)
- [Removing a Single Snapshot](./commands/forget/remove_single_snapshot.md)
Expand Down
41 changes: 32 additions & 9 deletions src/commands/restore/using_mount.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
# Restore using mount

**NOTE**: `rustic` doesn't support `mount` at this point, please use `restic` to
invoke this operation for the time being. We are working on a `mount`
implementation for `rustic`.
**NOTE**: `rustic` currently only supports `mount` for linux; we are working on
support for other operation systemss.

Browsing your backup as a regular file system is also very easy. First, create a
mount point such as `/mnt/rustic` and then use the following command to serve
the repository with FUSE:

```console
$ mkdir /mnt/rustic
$ restic -r /srv/rustic-repo mount /mnt/rustic
enter password for repository:
Now serving /srv/rustic-repo at /mnt/rustic
Use another terminal or tool to browse the contents of this folder.
When finished, quit with Ctrl-c here or umount the mountpoint.
$ rustic mount /mnt/rustic
```

Now you can access the backup content like a normal filesystem, i.e. you can
simply copy files from the respository snapshots.

**NOTE**: Copying files using `mount` may be not as efficient as using `restore`
as `restore` is highly optimized and knows in the beginning what exactly will be
restored.

**NOTE** Keep in mind that every file access on the mounted repository may
involve access to the repository. Especially read access to lots of data may be
expensive depending on the backend. It is not advised to run compare tools or
something like `rsync` on the mounted dir if you use a remote backend. Use
`diff` or `restore` if you want to compare or sync content with your lokal saved
files.

**NOTE**: When using a hot/cold repositories, file access is only possible if
the needed data is warmed-up in the cold repository part. By default rustic
therefore forbids file-access by default, see `--file-access` below.

There are various options which can be used with the `mount` command:

- You can specify the exact snapshot/path to mount, e.g.
`rustic mount /mnt/rustic latest:/home`
- If no snapshot/path is given, all snapshots are displayed in a tree, you can
use `--path-template` and `--time-template` to define the tree structure, e.g.
first group by hostname and then by snapshot date/time.
- You can give additional mount options using `--exclusive` or `--option`.
- `--file-access` allows to restict access to only listing dirs and.

<!-- TODO!:
Mounting repositories via FUSE is only possible on Linux, macOS and FreeBSD. On
Linux, the `fuse` kernel module needs to be loaded and the `fusermount` command
needs to be in the `PATH`. On macOS, you need
[FUSE for macOS](https://osxfuse.github.io/). On FreeBSD, you may need to
install FUSE and load the kernel module (`kldload fuse`).
<!-- TODO!:
rustic supports storage and preservation of hard links. However, since hard
links exist in the scope of a filesystem by definition, restoring hard links
from a fuse mount should be done by a program that preserves hard links. A
Expand Down
39 changes: 39 additions & 0 deletions src/commands/restore/webdav.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Restore using webdav

Another possibility is browsing your backup as webdav share. This option can be
also used to mount the repository on either remote computers or locally if
`mount` is not supported for your operation system. To start a webdav server,
just run

```console
$ rustic webdav
```

Now you can connect using a standard webdav client.

**NOTE**: Copying files using `webdav` may be not as efficient as using
`restore` as `restore` is highly optimized and knows in the beginning what
exactly will be restored.

**NOTE** Keep in mind that every file access via webdav may involve access to
the repository. Especially read access to lots of data may be expensive
depending on the backend. It is not advised to run compare tools or something
like `rsync` if you mount the webdav in case you are use a remote backend. Use
`diff` or `restore` if you want to compare or sync repository content with each
other or with your local saved files.

**NOTE**: When using a hot/cold repositories, file access is only possible if
the needed data is warmed-up in the cold repository part. By default rustic
therefore forbids file-access by default, see `--file-access` below.

There are various options which can be used with the `webdav` command (most
similar to [mount](using_mount.md))

- You can specify the exact snapshot/path to mount, e.g.
`rustic webdav latest:/home`
- If no snapshot/path is given, all snapshots are displayed in a tree, you can
use `--path-template` and `--time-template` to define the tree structure, e.g.
first group by hostname and then by snapshot date/time.
- `--address` allows you to give the bind address.
- `--symlinks` also enables symlinks.
- `--file-access` allows to restict access to only listing dirs and.

0 comments on commit 3aa6e50

Please sign in to comment.