# \[Suggestion\] Filter "Exclude folder if it contains a file xy" just like .nomedia

**URL:** https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750
**Category:** Features
**Created:** [September 21, 2017, 1:41pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750 "2017-09-21T13:41:56Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Tapio](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tapio/32/3371_2.png) [@Tapio](https://forum.duplicati.com/u/Tapio)
#### Post date: [September 21, 2017, 1:41pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/1 "2017-09-21T13:41:56Z")

</div>

Hey I have got a suggestion.

You know, in Android folders are avoided for picture indexation if they have a file “.nomedia”.

–\> Duplicati could avoid backup of folders (and subfolders) if folder contains a specific file. I.e. let us add a filter:  
"Exclude folder if it contains a file called… []"  
And we can define our own standard.

---

<div class="post-metadata">

### Author: ![drakar2007](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drakar2007/32/230_2.png) [@drakar2007](https://forum.duplicati.com/u/drakar2007)
#### Post date: [September 21, 2017, 3:05pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/2 "2017-09-21T15:05:15Z")

</div>

That’s a good idea, and from a meta perspective (i.e. not knowing the code myself, but knowing a bit about coding in general), seems like it might be fairly easy to implement.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 21, 2017, 4:13pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/3 "2017-09-21T16:13:25Z")

</div>

So something like "if folder contains a file named `.duplicati-no-backup` then don’t backup it or any subfolder?

Or would you think it needs to be more flexible like supporting multiple indicators such as:

- if `.duplicati-no-backup-files` found, don’t backup FILES in this folder
- if `.duplicati-no-backup-tree` found, don’t hackup files OR subfolders in this folder

---

<div class="post-metadata">

### Author: ![drakar2007](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drakar2007/32/230_2.png) [@drakar2007](https://forum.duplicati.com/u/drakar2007)
#### Post date: [September 21, 2017, 4:51pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/4 "2017-09-21T16:51:21Z")

</div>

Personally, if i were implementing this advanced option, i’d provide a field for the filename and a [dropdown] field for the action.

I can foresee use cases where a user has marker files or exclusion files already in their system and simply want duplicati to check for those - providing your own filename would make this a lot easier than trying to go around and populate a pre-set filename.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 21, 2017, 5:06pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/5 "2017-09-21T17:06:23Z")

</div>

While there are a lot of pre-existing examples (like .nomedia) of this where the user doesn’t get to choose the magic file name, I do like your idea of joining “magic name” with “action”. I’d suggest having some defaulted suggstions such as the `.duplicati-<action-name>`

The only thing that worries me is this opens up a lot of potential for somebody choosing something like `Thumbs.db` as their magic file name and then complaining because Duplicati didn’t back up stuff they expected it to back up.

That makes me think the perfect place for this is actually in the Advanced Filters area where peopple are already able to do scary things.

And on top of that, there should be a “show me what folders or files will be EXCLUDED” feature for verification purposes. (Note that I only put that in because chances are that either already exists or was suggested by somebody 30 years ago. 😃 )

---

<div class="post-metadata">

### Author: ![drakar2007](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drakar2007/32/230_2.png) [@drakar2007](https://forum.duplicati.com/u/drakar2007)
#### Post date: [September 21, 2017, 5:37pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/6 "2017-09-21T17:37:30Z")

</div>

> [@Tapio](#):
>
> Hey I have got a suggestion

As an aside, this post would be best suited for the “Features” category (or perhaps “UX”, i’m on the fence about that) - instead of “Support” where it’s been started.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 21, 2017, 6:11pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/7 "2017-09-21T18:11:22Z")

</div>

> [@drakar2007](#):
>
> this post would be best suited for the “Features” category

Good point, thanks - I’ll move it to Features since what (if any) functionality eventually decided on will likely drive necessary UX changes.

---

<div class="post-metadata">

### Author: ![Tapio](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tapio/32/3371_2.png) [@Tapio](https://forum.duplicati.com/u/Tapio)
#### Post date: [September 22, 2017, 10:42am UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/8 "2017-09-22T10:42:11Z")

</div>

> [@drakar2007](#):
>
> Personally, if i were implementing this advanced option, i’d provide a field for the filename and a [dropdown] field for the action.

I was thinking of an additional filter. I.e., a per-backup-set setting. If it was implemented as a standard and rather monolithic like with .nomedia, people may forget about it and raise support questions (“it does not backup some folders, why”).

I am against a global option because in my use case I want that to behave differently in online/offline backup.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 22, 2017, 3:07pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/9 "2017-09-22T15:07:02Z")

</div>

I agree, per-backup-set makes sense.

When I said “defaulted suggstions[sic]” I meant that I feel in the GUI when selecting that you want to use a “magic file exclusion filter” a **_suggested_** name should be defaulted in the field rather than just leaving a blank text field.

---

<div class="post-metadata">

### Author: ![drakar2007](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drakar2007/32/230_2.png) [@drakar2007](https://forum.duplicati.com/u/drakar2007)
#### Post date: [September 22, 2017, 3:17pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/10 "2017-09-22T15:17:17Z")

</div>

I agree - though I would opt for it being available both as a global _and_ per-backup setting, in a stacking manner, just since if there was one very important thing I wanted to exclude from all backup jobs, it would suck to have to remember to re-do the setting everywhere.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 22, 2017, 3:25pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/11 "2017-09-22T15:25:45Z")

</div>

Yep - I guess I was assuming that treating it like any other Exclude option would make it available as a POTENTIAL global setting.

We just probably shouldn’t “default it to on”. 🙂

---

<div class="post-metadata">

### Author: ![KateCoach](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@KateCoach](https://forum.duplicati.com/u/KateCoach)
#### Post date: [April 10, 2019, 12:05pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/12 "2019-04-10T12:05:49Z")

</div>

> [@Tapio](#):
>
> Hey I have got a suggestion.
> 
> You know, in Android folders are avoided for picture indexation if they have a file “.nomedia”.
> 
> –\> Duplicati could avoid backup of folders (and subfolders) if folder contains a specific file. I.e. let us add a filter:  
> “Exclude folder if it contains a file called… ”  
> And we can define our own standard.

Wow, all ingenious is simple!

---

<div class="post-metadata">

### Author: ![bcsteeve](https://forum.duplicati.com/user_avatar/forum.duplicati.com/bcsteeve/32/5013_2.png) [@bcsteeve](https://forum.duplicati.com/u/bcsteeve)
#### Post date: [March 11, 2022, 11:31pm UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/13 "2022-03-11T23:31:23Z")

</div>

I don’t suppose this ever got implemented and I’ve just missed it in the settings?

---

<div class="post-metadata">

### Author: ![warwickmm](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/w/5e9695/32.png) [@warwickmm](https://forum.duplicati.com/u/warwickmm)
#### Post date: [March 12, 2022, 1:28am UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/14 "2022-03-12T01:28:46Z")

</div>

Does the `--ignore-filenames` option do what you want?

> **[Advanced Options - Duplicati 2 User's Manual](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#ignore-filenames)**
>
> Documentation for Duplicati 2

---

<div class="post-metadata">

### Author: ![bcsteeve](https://forum.duplicati.com/user_avatar/forum.duplicati.com/bcsteeve/32/5013_2.png) [@bcsteeve](https://forum.duplicati.com/u/bcsteeve)
#### Post date: [March 12, 2022, 1:42am UTC](https://forum.duplicati.com/t/suggestion-filter-exclude-folder-if-it-contains-a-file-xy-just-like-nomedia/750/15 "2022-03-12T01:42:38Z")

</div>

Yup, sure looks like it! Thanks
