# Common exclusions and inclusions from %APPDATA%

**URL:** https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807
**Category:** Support
**Created:** [September 24, 2017, 10:20pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807 "2017-09-24T22:20:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 24, 2017, 10:20pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/1 "2017-09-24T22:20:48Z")

</div>

Continuing the discussion from [Staggered versioning / thinning out versions](https://forum.duplicati.com/t/staggered-versioning-thinning-out-versions/419/5):

> [@Staggered versioning / thinning out versions](https://forum.duplicati.com/t/staggered-versioning-thinning-out-versions/419/4):
>
> Annoyingly %APPDATA% and %LOCALAPPDATA% often are used for both for storing configuration data (which I want to backup) and cache / temp files (which of course I don’t care about).
> 
> So I’d have to go through each and every program and check where it keeps its cache / temp files to specifically exclude them …

> [@Staggered versioning / thinning out versions](https://forum.duplicati.com/t/staggered-versioning-thinning-out-versions/419/5):
>
> I cherrypick the ones where I know exactly which backups would be helpful (plex DB, firefox bookmark saves, notpead++ temp files, etc), and leave the rest basically alone.

In order to make it easier to tackle the APPDATA problem, how about building a repository of common [exclude and include filters](https://www.duplicati.com/articles/Filters/) that people can copy and paste into their backup jobs?

_(Just to keep things simple, let’s limit this topic to Windows. Feel free to start a similar topic for another OS)_

One starting point might be these posts from crashplan:

[https://support.code42.com/CrashPlan/4/Backup/Back\_up\_the\_AppData\_folder\_in\_Windows](https://support.code42.com/CrashPlan/4/Backup/Back_up_the_AppData_folder_in_Windows)

[https://support.code42.com/CrashPlan/4/Troubleshooting/What\_is\_not\_backing\_up](https://support.code42.com/CrashPlan/4/Troubleshooting/What_is_not_backing_up)

So, from those I gather the following AppData related exclusions:

```plaintext
.*/AppData/Local/Temp.*
.*/AppData/Temp.*

.*/AppData\Local\Microsoft\Windows\Notifications\WPNPRMRY.tmp
.*/AppData\Local\Microsoft\Windows\UsrClass.dat.LOG1
.*/AppData\Local\Microsoft\Windows\UsrClass.dat.LOG2
.*/AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat
.*/AppData\Roaming\Skype\your.skypename\main.lock
.*/AppData\Local\Google\Drive\lockfile
.*/AppData\Local\Microsoft\Internet Explorer\Recovery\High\Active*.dat
.*/AppData\Roaming\Mozilla\Firefox\Profiles\<profile>.default\parent.lock
.*/AppData\Local\Google\Chrome\User Data\Default\Current Session
.*/AppData\Local\Google\Chrome\User Data\Default\Current Tabs
.*/AppData\Local\Google\Chrome\User Data\lockfile

```

(Not sure whether forward-slash or backslash are correct here. Neither have I tried whether the RegEx syntax above actually works with duplicati.)

Please share your exclusion/ inclusion settings for the AppData folder. 🙂

---

<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 25, 2017, 1:07am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/2 "2017-09-25T01:07:38Z")

</div>

> [@tophee](#):
>
> a repository of common exclude and include filters

Thank you! I’ve been planning to start this very topic for a while but am still reviewing my own backup contents to see what else can be filtered out.

---

<div class="post-metadata">

### Author: ![sanderson](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanderson](https://forum.duplicati.com/u/sanderson)
#### Post date: [September 25, 2017, 4:35am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/3 "2017-09-25T04:35:06Z")

</div>

For what it’s worth, here is the short list I came up with to get started (includes more than just AppData).

```
-*.part
-*.tmp
-*.ost
-hiberfil.sys
-pagefile.sys
-swapfile.sys
-*\UsrClass.dat*
-*\ntuser.dat*
-$Recycle.Bin\
-Windows\
-MSOCache\
-*System Volume Information*\
-*\AppData\*\Temp\
-*\AppData\*\Internet Explorer\
-*\AppData\*\Microsoft\*\WebCache\
-*\AppData\*\Microsoft\*\INetCache*\
-*\AppData\*\Microsoft\Office\*\OfficeFileCache\
-*\Temporary Internet Files\
-*\Firefox\Profiles\*\*cache*\
-*\Microsoft\Windows Defender*\
-[.*\x7E\$[^\\]*]

```

Looks like you can’t override an exclude filter with an explicit “+” include entry, so I’m probably going to end up dropping the exclusion for the Windows directory so I can backup the Duplicati-server.sqlite database in C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati.

---

<div class="post-metadata">

### Author: ![tophee](https://forum.duplicati.com/user_avatar/forum.duplicati.com/tophee/32/21_2.png) [@tophee](https://forum.duplicati.com/u/tophee)
#### Post date: [September 25, 2017, 5:49am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/4 "2017-09-25T05:49:25Z")

</div>

> [@sanderson](#):
>
> Looks like you can’t override an exclude filter with an explicit “+” include entry

Really? I was assuming that adding an include filter will overwrite any exclude filter there may be, but I haven’t tried it yet. Have you?

---

<div class="post-metadata">

### Author: ![sanderson](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanderson](https://forum.duplicati.com/u/sanderson)
#### Post date: [September 25, 2017, 6:12am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/5 "2017-09-25T06:12:51Z")

</div>

Yes tried a bit earlier without any success. Tried it at the start of the list as well as the end on the off chance it mattered if the include was read in first or last.

It’s possible I messed up the syntax so curious to hear if anyone else gets it working. I had assumed that an explicit include would trump an exclude as well.

---

<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 25, 2017, 2:53pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/6 "2017-09-25T14:53:42Z")

</div>

> [@sanderson](#):
>
> I had assumed that an explicit include would trump an exclude as well.

I haven’t tried it myself but I think it is doable with something like [this as mentioned on Github](https://github.com/duplicati/duplicati/wiki/How-do-filters-work%3F):

> Include some files, exclude others. Now let’s define a filter that does both of the above. First it excludes @eaDir specifying -_/@eaDir/. Then it includes only JPG files specifying +_.jpg. The problem here is, that Duplicati includes all files and folders per default. This means that e.g. /photos/movie.avi will also be part of the backup. To make the including rule effective an additional rule is required that excludes all files that do not match any of the current rules. The filter must say “exclude this, exclude that, include this but nothing else”. The best rule for “but nothing else” is a regular expression that excludes all files. It is -._[^/] on Linux or Mac, and on Windows the rule is -._[^\]. The rule says “exclude everything that is not a folder”. The final filter then is -_/@eaDir/ +_.jpg +_.jpeg -._[^/]. Duplicati will process all folders but @eaDir/ and it will include JPG and JPEG files but exclude all other files.

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [September 25, 2017, 8:58pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/7 "2017-09-25T20:58:43Z")

</div>

A user called @tygill already made this, and it is part of the latest canary:

> <https://github.com/duplicati/duplicati/pull/2740/files#diff-befff654cb3df31cdfe1645905cfd2f2R162>

---

<div class="post-metadata">

### Author: ![Gabriel\_Ambuehl](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/g/ecb155/32.png) [@Gabriel\_Ambuehl](https://forum.duplicati.com/u/Gabriel_Ambuehl)
#### Post date: [September 30, 2017, 11:13am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/8 "2017-09-30T11:13:39Z")

</div>

Will enabling this (or more generally, adding any new exclusions) result in these files eventually getting purged from the remote dblocks or will the versions prior to the change in filters/exclusions stay there until they would get removed from being too old?

Also my reading is this should be available in the latest canary but I cannot find it anywhere in the GUI?

---

<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 30, 2017, 3:13pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/9 "2017-09-30T15:13:26Z")

</div>

> [@Gabriel\_Ambuehl](#):
>
> Will enabling this (or more generally, adding any new exclusions) result in these files eventually getting purged from the remote dblocks or will the versions prior to the change in filters/exclusions stay there until they would get removed from being too old?

Duplicati should treat previously included files that are now excluded due to filter (or folder) changes the same way as if they had been deleted, so versions (and eventually the backed up files themselves) will be removed from the dblocks based on whatever “keep” rules are set in the backup.

In other words, filter and source folder changes do NOT cause an immediate purge of dblock contents.

---

<div class="post-metadata">

### Author: ![davegold](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/d/71e660/32.png) [@davegold](https://forum.duplicati.com/u/davegold)
#### Post date: [October 24, 2017, 11:59pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/10 "2017-10-24T23:59:45Z")

</div>

Windows has a default exclusion list already, it is in the registry at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup

I posted the question on the forums, but this might be a good way to generate the list instead of having a manually generated one. Or in addition…

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [October 30, 2017, 11:58am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/11 "2017-10-30T11:58:06Z")

</div>

> [@davegold](#):
>
> Windows has a default exclusion list already, it is in the registry at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup

Awesome, I did not know that one. I guess this should be part of the default filters.

---

<div class="post-metadata">

### Author: ![sanderson](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanderson](https://forum.duplicati.com/u/sanderson)
#### Post date: [October 31, 2017, 3:48am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/12 "2017-10-31T03:48:22Z")

</div>

I could see maybe offering to import it on first install into the Duplicati config (or one time importing it silently). After that though, it seems like it would be somewhat confusing if the registry settings were used and files were being excluded from Duplicati backups that you have to go manage completely outside of Duplicati?

---

<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: [October 31, 2017, 6:18am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/13 "2017-10-31T06:18:46Z")

</div>

> [@sanderson](#):
>
> it seems like it would be somewhat confusing if the registry settings were used and files were being excluded from Duplicati backups that you have to go manage completely outside of Duplicati

I sounds like the GUI might need the “Source data” Exclude section to be updated to include more detail on exclusions from less obvious sources (such as external or hard coded internal lists).

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [October 31, 2017, 10:05am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/14 "2017-10-31T10:05:46Z")

</div>

> [@davegold](#):
>
> Windows has a default exclusion list already, it is in the registry at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup
> 
> I posted the question on the forums, but this might be a good way to generate the list instead of having a manually generated one. Or in addition…

I made an addition for it here:

> <https://github.com/duplicati/duplicati/commit/2ff3fa6a8d56bc1b5d7900cc2348e9e71fe730df>

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [October 31, 2017, 10:12am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/15 "2017-10-31T10:12:51Z")

</div>

> [@sanderson](#):
>
> I could see maybe offering to import it on first install into the Duplicati config (or one time importing it silently). After that though, it seems like it would be somewhat confusing if the registry settings were used and files were being excluded from Duplicati backups that you have to go manage completely outside of Duplicati?

Are you thinking that some users (or applications) will edit the list in the registry?

That would be strange, but I guess anything added to this key is really not meant to be backed up.

Not sure how to handle that, because the change would happen via another program that is not related to backup, and the user would not want the change the other program makes.

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [October 31, 2017, 10:13am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/16 "2017-10-31T10:13:29Z")

</div>

> [@JonMikelV](#):
>
> I sounds like the GUI might need the “Source data” Exclude section to be updated to include more detail on exclusions from less obvious sources (such as external or hard coded internal lists).

Yes, I think the UI needs to correctly reflect the default excludes.

---

<div class="post-metadata">

### Author: ![davegold](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/d/71e660/32.png) [@davegold](https://forum.duplicati.com/u/davegold)
#### Post date: [November 1, 2017, 4:12am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/17 "2017-11-01T04:12:03Z")

</div>

I don’t think we should do anything to note changes that something outside of Duplicati makes to those registry keys.  
I’d suggest that these default exclusions using this registry key can be implemented in one of two ways:

1. Those keys are read during each backup run and added as a dynamic exclusion. Similar idea to the “temporary files” exclusion that excludes files with the “temporary attribute set”, in that it is a dynamic operation.  
If someone really wanted, add an option to not use the windows keys.
2. Make it an option “–use-windows-default-exclusions” that has to be activated.

I vote for option 1, and here is why: that is the way that Microsoft says to do so. See [Registry Keys and Values for Backup and Restore (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/bb891959(v=vs.85).aspx) for details.

In terms of having an option to not follow Microsoft’s specification, my gut says that is a mistake. I’ve installed enterprise backup software for about 20 years, and have never seen documentation that notes that these registry keys are used to exclude data. At best, I’ve run across it in a knowledgebase, and more often its been an engineering guide. It may be part of being qualified by Microsoft, I don’t know–but nowhere can I remember there being a “ignore windows files/dirs to skip”.

And if someone is advanced enough to modify those registry keys, all the more power to them.

---

<div class="post-metadata">

### Author: ![sanderson](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanderson](https://forum.duplicati.com/u/sanderson)
#### Post date: [November 2, 2017, 12:59am UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/18 "2017-11-02T00:59:41Z")

</div>

#1 makes the most sense to me, so long as it’s clearly stated somehow/somewhere to the end user that there are exclusions being enforced outside of Duplicati config. A way to bypass it when/if Microsoft does something dumb isn’t ever a bad idea 🙂 .

Another checkbox for “exclude OS defined files” or something would take care of both.

---

<div class="post-metadata">

### Author: ![vegar](https://forum.duplicati.com/user_avatar/forum.duplicati.com/vegar/32/978_2.png) [@vegar](https://forum.duplicati.com/u/vegar)
#### Post date: [January 2, 2018, 1:03pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/19 "2018-01-02T13:03:28Z")

</div>

I added `--default-filters=Windows ` to my existing backup definition.  
Still the backup complains about NTUSER.DAT:

> Warnings: [  
> Failed to process path: C:\Users\vegar\NTUSER.DAT =\> The process cannot access the file ‘C:\Users\vegar\NTUSER.DAT’ because it is being used by another process.,  
> Failed to process path: C:\Users\vegar\ntuser.dat.LOG1 =\> The process cannot access the file ‘C:\Users\vegar\ntuser.dat.LOG1’ because it is being used by another process.,  
> Failed to process path: C:\Users\vegar\ntuser.dat.LOG2 =\> The process cannot access the file ‘C:\Users\vegar\ntuser.dat.LOG2’ because it is being used by another process.,  
> …  
> ]

Shouldn’t this warning go away if the default filter was in use?  
[https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Utility/DefaultFilters.cs#L210-L211](https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Utility/DefaultFilters.cs#L210-L211)

---

<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: [January 2, 2018, 6:46pm UTC](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807/20 "2018-01-02T18:46:35Z")

</div>

> [@vegar](#):
>
> Shouldn’t this warning go away if the default filter was in use?

Yes, I would think so…I’m not sure why it’s not working for you.

If you manually add those filters (with back slashes instead of forward) does it work for you? I’m curious if the issue lies somehow in the wildcard vs. the application of the Windows filter set.

[Next page](https://forum.duplicati.com/t/common-exclusions-and-inclusions-from-appdata/807.md?page=2)
