Filter common subfolders

Nelvin     Dec 22 4:59AM 2017 CLI

One more early question - I do have countless folders where I have a common named folder (I use "_inbox" so it get's sorted at the top of the folder) where I just put volatile data, pdfs, images etc. I download but nothing of relevance.

Would a simple folder filter work with this or will I have to use regular expressions to make these files not end in the backup?

I.e. let's say I have the following folders

projects\birthday_dad

projects\birthday_dad\ _inbox

projects\birthday_dad\ ... many more folders I'd like to backup

projects\holiday_2018

projects\holiday_2018\ _inbox

projects\holiday_2018\ ... many more folders I'd like to backup

and I'd like to backup all the files and subfolders but not those "_inbox" ones.

Thanks, Nelvin


gchen    Dec 22 10:47AM 2017

-projects/*/_inbox should exclude all those folders.


Nelvin    Dec 24 7:11AM 2017

thanks, will give this a try soon


Nelvin    Dec 25 7:10PM 2017

Another question about filters - how would I create filters that work without requiring a concrete folder to be defined.

F.i. let say I'd have filters just including all files ending with .txt Or filters excluding all files ending with .tmp


gchen    Dec 25 9:36PM 2017

To include all *.txt files:

+*.txt
+*/
-*

The second pattern includes all directories so every subdirectory will be visited. The third pattern excludes all other files.

To exclude all `*.tmp' files:

-*.tmp
+*

The second pattern include all other files or directories.


Nelvin    Dec 26 7:52AM 2017

Thanks a lot for all your fast answers so far.

I have one more questions with regards to the filters.

Is it possible to create a simple pattern to include all folders and subfolders but only at a defined basefolder, and if so, is it also possible to select files based on a pattern within these folders then?

Sample layout

projects/

projects/scratchpad.txt

projects/notes/2017/

projects/notes/2017/notes.txt

projects/notes/2017/notes.tmp

projects/notes/2018/january/notes.txt

projects/notes/2018/february/notes.txt

So in this case if I'd like to backup the .txt files but only those within some subfolders of projects/notes. Is it possible to create a filter where a part of the path is fixed (projects/notes/) but then matches every subfolders starting at that level so that it will also work if I add another level to the sample above without the need to change the filters?

I.e. if I'd add

projects/notes/2018/march/week1/notes.txt

projects/notes/family/birthday/gift_ideas.txt

etc.

Sorry for all the questions - I always try to figure out a solution on my own but sometimes I'm just stuck with an idea that I can't figure out how to make it work.


gchen    Dec 26 10:13AM 2017

This should work:

+projects/*.txt
+projects/*/
-projects/*

The first pattern applies to all *.txt under projects (including all subdirectories), the second pattern includes all subdirectories under projects, and the last one excludes all other files.


Nelvin    Dec 26 12:50PM 2017

Thanks again for your help ... I think I eventually got it and now know how to use them to do what I'd like to do :)