Skip to content

[Feature Request] restore: option to skip destination scan when restoring to original paths #1706

@srevn

Description

@srevn

When running restore to a destination that already contains files, rustic scans the entire destination tree before writing anything, including directories the current user might not have permission to read. This causes the restore to fail even in --dry-run mode.

[ERROR] Error during collection of files: WithPath { path: "/Library/Application Support/Apple/AssetCache/Data", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 5, inner: Io { path: Some("/Library/Application Support/Apple/AssetCache/Data"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }

To restore profiles containing absolute paths to their original locations, the natural destination is / or a volume root. This hits system-protected directories unrelated to the backup. A workaround is to run with sudo, but that still takes too long when destination is something like /Volumes/Macintosh.

Not sure if an option to skip scanning is actually the correct approach for this project. Adjusting the scope of scanning might be more appropriate, limiting destination scan to paths present in snapshot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: Waiting for a maintainer to triage this issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions