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?
- What OS are you running on?
- What version of Duplicati are you using?
- What do you mean by âonly back up the folders inside, not any folderâ?
- 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?
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
and i want the following
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:
or
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.
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:
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.