Exclude folder in root of profile but not in subdirectory

General Discussion in English
Post Reply
IMTheNachoMan
Posts: 86
Joined: Sun Nov 20, 2022 5:11 am

Exclude folder in root of profile but not in subdirectory

Post 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?

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

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

Post 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.

IMTheNachoMan
Posts: 86
Joined: Sun Nov 20, 2022 5:11 am

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

Post 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?

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

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

Post by tobias »

Hi,
yes that works too.

IMTheNachoMan
Posts: 86
Joined: Sun Nov 20, 2022 5:11 am

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

Post 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?

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

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

Post 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.

Post Reply