Include only a specific typ of folder

Hello

I want to create a backup which will only include all file and folders in a specific folder (which has results in the name).

i have used following filter, but it only back up the folders inside, not any folder.
-*results\

Can any one please explain what am i doing wrong here?

BR
Roni

Setup a new backup with the source folder as that \path\fileresults folder. You can have multiple backups pointing at specific folders, it does not have to be the top level drive/folder.
It may also help to map that specific drive to something like R: in Windows or \mount\sdr\ in linux so it is a static location that Duplicati (and whatever else) can have direct access to. This is especially helpful if that folder is nested deeper under a longer path such as (for example) \usr\user\myfiles\testing\items\testresults or \networklocation\files\myfiles\testing\items\testresults, just make sure the security and permissions are set properly so the user or login in Duplicati is able to access them.

The filter from what I understand is typically used more for specific file names results.txt or img.jpg, and does not work as well regarding folders (in my experience), but that can also be OS specific as well on whether it looks at folder and files, or just files.

Hello @Arif_Roni, welcome to the forum!

While mikaitech has some good ideas I’m not sure they solve your particular issue so could you clarify some things for us?

  1. What OS are you running on?
  2. What version of Duplicati are you using?
  3. What do you mean by “only back up the folders inside, not any folder”?
  4. Can you provide examples of the paths you are trying to hit?
  5. Is the sample -*results\ filter you showed being used in the GUI field or part of the “Show as text” option?

Working with that I know so far…

  • it sounds like you want an INCLUDE filter (prefixed with + plus), not an exclude one (prefixed with a - minus/dash) [note: technically I supposed you could have a filter that excludes anything that does NOT have results in the folder name
  • I believe the -*results\ sample you provided would only include folders that END with result, so it would not include results1, resultsDecember, etc. - is that what you want?

Note that if these folders are always the same then you could directly add them to your “Source data” folder list…

Hi @JonMikelV

Thanks for the reply.

  • What OS are you running on? --> windows 10

  • What version of Duplicati are you using? --> Duplicati - 2.0.3.3_beta_2018-04-02

  • What do you mean by “only back up the folders inside, not any folder”? --> mistake, not any file. so it only kept the folder structures, not any files!

  • Can you provide examples of the paths you are trying to hit?

  • Is the sample -*results\ filter you showed being used in the GUI field or part of the “Show as text” option? --> show as text option and it is another mistake i did in the posting, i used + instead of -

Example:
i have following structure
1

and i want the following
2

Thanks for the clarifications.

In your example structure you seem to be wanting to exclude:

  • drive/project1/sub_project1/data/ (folder)
  • drive/project1/sub_project1/simulation/sim_file (file)
  • drive/project2/sub_project2/data/ (folder)
  • drive/project2/sub_project2/simulation/sim_file (file)

I’m a bit rusty on filters, but I believe to do that you would want filters something like this (at least on Windows):

-[\\project.*\\sub_project.*\\data\\]
-[\\project.*\\sub_project.*\\simulation\\sim_file]

Which would look a bit like one of these:
image

or
image


It might help to read these this page on using filters.

1 Like

OK, i know this already, but maybe the example was not a very good one. In reality i will have many unknown folders which is impossible for me to exclude, but one thing is for sure that there is a *results folder and i only want this folder, and these results folders are also in many subfolder…i cant also backup these results folder one by one. I hope you understand my problem.

So you have a tree full of various folders but you only want to back up the ones named “results”?

Does this do what you want?

  • Include regular expression: \\**\\results\\
  • Edit as text: +[\\**\\results\\]

The ** basically says ANY folder level, so in theory that should include ONLY “trees” that end with a “\results” folder. Of course, that means you won’t get any folders BELOW that folder…is that OK?

I used this filter but it seems its not working.

1

And the result is

Try “Include expression”: D:\Duplicati\TEst\**\results\* (Edit as text line: +D:\Duplicati\TEst\**\results\*).

It should only include files in the “Results” folder. I don’t know that it’s possible to get it to exclude what are essentially empty folders since once a folder is excluded, none of the subfolders are processed. This means, as soon as Duplicati gets to “\test” it will say “you don’t end in ‘\result’ so I’m going to exclude you AND ALL OF YOUR SUBFOLDERS”.


Here’s my test folder structure:
image


Here’s my results of test-filters command:

Finished!

            
Including source path: D:\Duplicati\TEst\
Including path due to filter: D:\Duplicati\TEst\Project1\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
Including path due to filter: D:\Duplicati\TEst\Project1\hello\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
Including path due to filter: D:\Duplicati\TEst\Project1\hello1\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
--->Excluding path due to filter: D:\Duplicati\TEst\Project1\New Text Document.txt => null
Including path due to filter: D:\Duplicati\TEst\Project1\hello1\hello.results\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
Including path due to filter: D:\Duplicati\TEst\Project1\hello1\results\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
Including path due to filter: D:\Duplicati\TEst\Project1\hello1\results\New folder\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
+++>Including path due to filter: D:\Duplicati\TEst\Project1\hello1\results\New folder\New Text Document.txt => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
Including path due to filter: D:\Duplicati\TEst\Project1\hello1\hello.results\New folder\ => (D:\DUPLICATI\TEST\**\RESULTS\*) || (*\)
--->Excluding path due to filter: D:\Duplicati\TEst\Project1\hello1\hello.results\New folder\New Text Document.txt => null
--->Excluding path due to filter: D:\Duplicati\TEst\Project1\hello\New Text Document.txt => null
Matched 1 files (0 bytes)
Return code: 0

Hello

sorry for the delayed response, but this is working fine. thank you.

BR
Roni

Thanks for letting is know it’s working for you!

I went ahead and flagged my post as the solution, please let me know if that’s incorrect.