Ask the Community
Groups
Including/Excluding Files and Directories in KDB - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>QUESTION</strong></p> <p>How do I include / exclude Files and Directories in KDB?</p> <p><strong>ANSWER</strong></p> <p>KDB uses the following order of precedence for including and excluding files and directories. The lower the number, the higher the priority.</p> <p> </p> <table><tbody><tr><td style="width: 260px;"> <p><strong>Type of Profile Entry</strong></p> </td> <td style="width: 246px;"> <p><strong>Precedence priority</strong></p> </td> </tr><tr><td style="width: 260px;"> <p>Include File</p> </td> <td style="width: 246px;"> <p>1</p> </td> </tr><tr><td style="width: 260px;"> <p>Exclude size > X</p> </td> <td style="width: 246px;"> <p>2</p> </td> </tr><tr><td style="width: 260px;"> <p>Exclude File Type*</p> </td> <td style="width: 246px;"> <p>3</p> </td> </tr><tr><td style="width: 260px;"> <p>Exclude File</p> </td> <td style="width: 246px;"> <p>4</p> </td> </tr><tr><td style="width: 260px;"> <p>Include Folder</p> </td> <td style="width: 246px;"> <p>5</p> </td> </tr><tr><td style="width: 260px;"> <p>Exclude Folder</p> </td> <td style="width: 246px;"> <p>6</p> </td> </tr><tr><td style="width: 260px;"> <p>Include File Type*</p> </td> <td style="width: 246px;"> <p>7</p> </td> </tr><tr><td style="width: 260px;"> </td> <td style="width: 246px;"> </td> </tr><tr><td style="width: 506px;"> <p>* Environment Variables work like include/exclude file types as well</p> </td> </tr></tbody></table><p> </p> <p>These include/exclude priorities apply any combination of the two methods of including/excluding files and directories:</p> <ul><li>Directory and file selection using the explorer tree on the Schedules page.</li> <li>Selections made to user profiles in the Backup Profiles page.</li> </ul><p><strong>Example 1</strong></p> <p>Include: C:\Folder\Temp\File.txt<br>Exclude File Type: .txt</p> <p>Result: backup will include: C:\Folder\Temp\File.txt, because Include File has highest precedence.</p> <p> </p> <p><strong>Example 2</strong></p> <p>Include File Type: .doc .xls .pdf<br>Exclude Folder: C:\SomeFolder\IngoreDirectory</p> <p>Result: all files will be backed up with the file types except for the excluded folder. Anytime you have an include file type a list of fixed drives is obtained from the system and eg. C:, <img class="emoji" src="https://kaseya.vanillacommunities.com/resources/emoji/anguished.png" title="D:" alt="D:" height="20" loading="lazy"></img>, F: and all files of the following include file types are backed up. This rule of include file type is applied to all folders under scanned drives.</p> <p> </p> <p><strong>Example 3</strong></p> <p>Include Environment Variable: %MyDocuments%<br>Exclude Folder: C:\Users\John.Doe</p> <p>Result: all My Documents will be backed up except for the excluded folder for a specific user. An environment variable behaves as an include file type so this is the one case where an excluded folder has higher priority over an included folder.</p> <p> </p> <p><strong>Example 4</strong></p> <p>Include Folder: C:\Folder\Temp<br>Exclude Folder: C:\Folder\Temp\Foo</p> <p>Result: C:\Folder\Temp and all sub-directories will be included, except for C:\Folder\Temp\Foo which has an exclusion applied.</p> <p> </p> <p><strong>Example 5</strong></p> <p>Include Variable: C:\Folder\Temp<br>Exclude Folder: C:\Folder</p> <p>Result: C:\Folder and all subdirectories will be excluded, except for c:\Folder\Temp which has an inclusion applied.</p> </article> </main>