Synchronization with excluded remote directories deletes local files

Advertisement

mangrove
Guest

Synchronization with excluded remote directories deletes local files

When using synchronization local <= remote and file masks to exclude remote directories, the option -delete actually deletes those local directories excluded by the remote mask! That can not be right. :shock: :lol: Instead, the behaviour one would expect is that the ignored directory would be unaffected on the local drive.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Re: Synchronization with excluded remote directories deletes local files

You have to exclude both the local and the remote directory.

If you exclude by name only, it's automatically applied to both sides.

If you exclude by full path, it's excluded only on the side with the respective path syntax.

Reply with quote

mangrove
Guest

Yup, this was the problem. (Together with an additional problem of missing trailing backslashes at the local side.)

However, I have read the documentation again and it was -- and still is -- not clear to me that this would happen. May I suggest an additional note in the form of:

"Note that excluding a path on only one side when using the option -delete will trigger a deletion on the other side, due to the deletion logic being applied after the exclusion logic"

Or something similar.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

I have added this to https://winscp.net/eng/docs/file_mask#path

The full path mask matches a local or a remote paths only, depending on syntax used. This matters for synchronization particularly, for which you may need to use a separate full path mask for both local and remote path. Or use a partial path mask

Reply with quote

Advertisement

You can post new topics in this forum