rustic icon indicating copy to clipboard operation
rustic copied to clipboard

feat(commands): Add `mount` command

Open aawsome opened this issue 1 year ago • 3 comments

This PR adds the mount command to rustic to access snapshot contents as a read-only filesystem when the feature-flag mount is chosen.

As for the webdav command, there are following options:

  • Access to a concrete snapshot/path, e.g. rustic mount /mnt 37a63e5b:/my/path.
  • Access to all snapshots (maybe restricted by filters) by using templates to define a virtual directory structure where snapshots are located. Example: rustic mount /mnt --path-template "[{hostname}]/[{label}]/{time}" --time-template "%Y-%m-%d_%H-%M-%S" (these are also defined as default). Note that for all dirs containing only snapshots, also a latest entry is generated. latest and identical subsequent snapshots are symlinks when using mount.

This PR uses fuse_mt which is not optimal as it introduces some overhead (e.g. needs to save whole Paths in-memory).

Note: Requires https://github.com/rustic-rs/rustic_core/pull/331 to properly show all data of files (without it builds and runs, but files are truncated and return error when reading).

Note: Building with the mount feature flag requires special dependencies and is only possible on supported platforms, see https://github.com/cberner/fuser

closes #971

aawsome avatar Dec 26 '23 00:12 aawsome