ignore pattern not understanding

Hi All

I am sure this has been asked number of times, but I can’t seem to find what I am after.

I am trying to sync my home directory between 2 laptops. Here is my scenario.

/Users/lanox -> I want to ignore everything, but then I want to add specific folders and content of them.

So my ignore file looks something like this.

!/Downloads !/personal-files *

Understanding ! -> anything that starts with that will be exclude. * -> Will ignore everything in ~

However nothing happens, meaning nothing is synced.

Thanks in advance for the help.

Did the scan finish, how many items did it find? Screenshot would help.

@AudriusButkevicius I will take a screenshot when I get home.

Yes sync was finished, I have clicked rescan on both laptops and scan was definitely finished. But no files.

So how I tested it:

created folder test inside test folder created {a..d}

then synced ~/lano

In my ignore list I had !/lano/a ( I tried few variants of this such as !/a/, !/lano/a !/lano/a/) none worked. *

but above did not sync anything, folder was empty on the other laptop.

How ever as soon as I cleared my ignore list I saw {a…d} got synced.

Hope that helps in any way.

You potentially need to unignore the content inside the folders, that is

!/foo
!/foo/*
*

Right, I will try that and let you know how I go.

Thanks

@AudriusButkevicius unfortunately that did not work, do you want me to take screenshoot from both laptops or just the one I am sinking from ?

thanks

Yeah screenshots from the side that is not discovering files would be nice, as I’d expect the local item count to be 0. Are you sure you are not ignoring the incoming files on the other side?

Also detailed steps of how to reproduce would be interesting so I could understand the issue better and test it myself.

Here is the photo from the laptop that is not discovering anything.

on my personal laptop I have this structure.

folder ~/lano/a,b,c,d

shared ~/lano folder with my work laptop

in the Ignore Pattern (last thing I tried.)

!/foo
!/foo/*
*

On the work laptop I have nothing in Ignore Pattern

Sorry but you have to be precise, the patterns do not match the folders you listed so I wouldn’t expect it to work, also did you verify which user syncthing is running as because ~/ can have a lot of different meanings.

sure sorry.

everything is correct except foo part.

so my Ignore Patterns (on my personal laptop)

!/lano !/lano/* *

and I am running synchthing as lpuljic as that is my laptop account I am logged in.

Well your patterns are incorrect, folder path already contains lano, so the patterns should not contain that as they are anchored to the root (~/lano), as it essentially tries to unignore ~/lano/lano/

Sorry I am confused now.

so should I just have

!/a *

?

1 Like

From what you posted, it looks like it. And I explained why, the patterns are relative to the folder root, just like gitignore and others.

I don’t know what I am doing wrong as this is not working.

Let me try explaining one more time incase I didn’t explain my self right.

laptop A (lets call it like this) is sharing folder path /Users/lpujic/lano inside lano folder I have a..d folders

My Ignore Pattern has, well I tried with this

!/lano
!/lano/*
*

but obviously not working

so I have tried

!/a *

also did not work.

On laptop B I have nothing in git ignore and nothing is been synced.

Did you try excluding the content inside of a as I initially suggested.

I have tried that as well and nothing. Tried this as well and not good. !/a /a/* !/a *

also just want to says thanks for the help and quick responds.

OMFG I am so embarrassed that I don’t even want to post my stupidity…

All working fine now.

Urm something happened and I am very confused.

After working out what I wanted(so I thought). I went ahead to sync my home folder.

I added folder ~lpuljic made it master then I changed refresh to 0 saved it so that I can kick it off manually.

Went back and add * to ignore everything.

On my other laptop it poped up that I want to share a folder I add it changed refresh to 0.

And boom all went to hell essentially my home folder got deleted and all the file and folders thank god for Dropbox backup and restore.

Confusing part is why didn’t ignore work ? I had * which I thought it will ignore everything ???

This ignoring is confusing least to say…

Well I don’t know what you did. If you can come up with a systematic detailed case of reliably reproducing the issue in a controlled environment, we can have a look.

@AudriusButkevicius firstly thank you very much for the prompt responds and awesome help, and sorry for silly questions.

I feel stupid already…

I truly don’t know what happen but this is exactly what I did.

Laptop A --> Sync from here

Add folder folder path: /Users/lpuljic share with: work laptop rescan Interval: 0 save

then I went back on folder clicked Edit and in Ignore Pattern I added !/Documents (Just to test on single Folder) *

Laptop B (work Laptop)

it Popped up saying Laptop A wants to share folder, I clicked Add Folder Path: /Users/lpuljic rescan Interval: 0 save

Next Thing I know files are been deleted from Laptop B It was a simple configuration.

Is there any logs that I can get or see what happened ?

That is all I have done Nothing more then that.