Filemask issue (5.0.6 beta)

Advertisement

szucsati
Guest

Filemask issue (5.0.6 beta)

Hi,

I'm using WinSCP 5.0.6 beta under Windows 7 x64 SP1. I call the winscp.com with a scripting file.

What I'm trying to do is to synchronize only specified folders recursively but leave all the others untouched.

Here's a sample file structure

dir_01\hello_01.txt
dir_02\hello_02.txt
dir_03\hello_03.txt
hello_00.txt

What I need is dir_01 and dir_01\hello_01.txt and dir_02 and dir_02\hello_02.txt to be synchronized, but dir_03 and hello_00.txt excluded.

In my understanding this would be like this:
-filemask="*/dir_01/;*/dir_02/|"

but this in fact synchronizes dir_01 and dir_02 recursively which is good, but also synchronizes hello_00.txt which I don't want.

I tried this too (amongst many others):
-filemask="*/dir_01/;*/dir_02/|*/*"

which, as I understand, would exclude all files from the root folder (non-recursive), but this excludes all files. It makes all directories synchronized but no files at all.

Am I doing something wrong?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Filemask issue (5.0.6 beta)

Might be easier to exclude the directories you do not want to synchronize, rather than include those you want to.

Anyway, there's no straightforward way to exclude root files, while keeping files in selected subfolders. One alternative is to use:
*/dir_01/;*/dir_02/|*/xxxx/*
Where xxxx is the name of the parent folder.

Reply with quote

szucsati
Guest

Re: Filemask issue (5.0.6 beta)

martin wrote:

Might be easier to exclude the directories you do not want to synchronize, rather than include those you want to.

Anyway, there's no straightforward way to exclude root files, while keeping files in selected subfolders. One alternative is to use:
*/dir_01/;*/dir_02/|*/xxxx/*
Where xxxx is the name of the parent folder.

Thanks for your reply.

Your solution seems to be working. The problem is that I don't always know the root folder's name, I usually have absolute path. And it only work in the way you put it, */dirname/*. Nice job to get the folder name in dos batch.

Correct me if I'm wrong, but according to the documentation, my first filemask should do what I want, shouldn't it?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Filemask issue (5.0.6 beta)

szucsati wrote:

Your solution seems to be working. The problem is that I don't always know the root folder's name, I usually have absolute path. And it only work in the way you put it, */dirname/*. Nice job to get the folder name in dos batch.
It works with absolute path too. But with absolute path, it makes difference, if it is local or remote absolute path. It depends on what kind of synchronization you are doinf.

Correct me if I'm wrong, but according to the documentation, my first filemask should do what I want, shouldn't it?
No.

The */dir_01/;*/dir_02/| says, include dir_01 and dir_02 folders and all files (it's implicit, when no file include mask is specified). The | is redundant, as well as */ before folder names. dir_01/;dir_02/ would do the same thing.

The */dir_01/;*/dir_02/|*/* says, include dir_01 and dir_02 folders, exclude all files. Again */ is redundant. dir_01/;dir_02/|* would do the same thing

Reply with quote

Advertisement

You can post new topics in this forum