Topic "Filemask issue (5.0.6 beta)"

Author Message
szucsati

Guest


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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.
_________________
Martin Prikryl
szucsati

Guest


prikryl 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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.

Quote:
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
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License