Page 1 of 1

Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 1:55 pm
by IMTheNachoMan
If I want to exclude .config in the root/base of a profile, but not exclude it in sub-folders, how can I do that?

Say my profile base is /home/me and I have files like this:
  • /home/me/.config/a
  • /home/me/.config/b
  • /home/me/apps/a
  • /home/me/apps/.config/c
  • /home/me/apps/.config/d
I want to exclude /home/me/.config but not /home/me/apps/.config. Is that possible?

Re: Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 3:30 pm
by tobias
Hello,
yes, the correct Exclusion Mask would be (on Windows):

\.config

So, start with a backslash but be relative to the base folder.

Even if you sync with an Internet Protocol that uses forward slashes, you should use backslashes here, if you are on Windows.

On macOS or Linux/NAS, you can use forward slashes always.

Re: Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 3:36 pm
by IMTheNachoMan
tobias wrote:
Sun Oct 22, 2023 3:30 pm
Hello,
yes, the correct Exclusion Mask would be (on Windows):

\.config

So, start with a backslash but be relative to the base folder.

Even if you sync with an Internet Protocol that uses forward slashes, you should use backslashes here, if you are on Windows.

On macOS or Linux/NAS, you can use forward slashes always.
Oh, nice. That makes sense.

Is it possible to exclude all files/folders that start with a . in the root folder?

Would \.* work?

Re: Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 3:57 pm
by tobias
Hi,
yes that works too.

Re: Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 8:07 pm
by IMTheNachoMan
tobias wrote:
Sun Oct 22, 2023 3:57 pm
Hi,
yes that works too.
Awesome. Is there any force override for exclusion? Like if a file would have been excluded but I want to deliberately include it?

Re: Exclude folder in root of profile but not in subdirectory

Posted: Sun Oct 22, 2023 8:53 pm
by tobias
Hello,
yes, for files if you specify a complete filename with subpath it will override it.
For example:
\.stuff\file.txt

But not for folders, I think.

In general please try not getting it too complicated, might be better to copy one folder more than less.