rustic-rs / rustic

rustic - fast, encrypted, and deduplicated backups powered by Rust
https://rustic.cli.rs
Apache License 2.0
1.99k stars 71 forks source link

Feature discussion: Programatically defined file-filtering. #1317

Open Ben-PH opened 1 month ago

Ben-PH commented 1 month ago

@simonsan and I started this discussion in discord. It's fitting to summarize and continue in here.

My use case: ignore the build output of a cargo project (i.e. ignore target directory when it shares a directory with Cargo.toml, edge-cases aside)

Current approach

Currently, one can ignore/include files based on approaches such as globs, respecting .gitignore files, etc. An initial suggestion was to respect .gitignore files. This works when file-management of a git project happens to mirror what you want to backup. It does not work when the things you want to backup don't align with what you want in your git repo, as it's not the job of .gitignore to filter what you want backed up. Personal configurations, such as IDE settings, comes to mind.

Some other scenarios, though arbitrary and contrived, illustrate the potential value of allowing some sort of programatic definition, or scriptability, to be added to the backup process:

I am curious to see where this discussion will take us.