borgbackup / borgbackup/borg

Exclude directory if some relative file is present in the filesystem

Open
#6,130 4 comments 0 reactions 0 assignees View on GitHub
patterns question
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
11h 15m
Merged PRs (30d)
192

Description

Sometimes it is reasonable to exclude directory, but only if some file is present.

### Example

Rust projects are defined by `Cargo.toml` file. All build files are placed to `target` directory in the project structure.
```
(project root)
|- Cargo.toml
|- src (contains source files)
| |- ...
|- target (contains build files generated by Rust tooling)
| |- ...
|- ...
```

We would like to exclude `target` directory only if the directory containing `target` directory contains also `Cargo.toml`.
In ZSH syntax it would be: `**/target(e:'[[ -f $REPLY/../Cargo.toml ]]':)`

Is it possible in Borg now?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.