synchronize local with include and exclude masks

Advertisement

DenimKnight
Guest

synchronize local with include and exclude masks

Hi there,

Really impressed with WinSCP but I've ran into an issue. I'm trying to synchronize local path with remote path and have to have an exclude mask and an include mask. For example I want to exclude folder a with a file path of /sftp/file/a but include all other folders (/sftp/file/b and /sftp/file/c) and within those folders I want to synchronize FileA.* and FileB.*.

Any pointers on what the script should looks like to do that? Is it possible?

Thanks
Alex

Reply with quote

Advertisement

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

Re: synchronize local with include and exclude masks

Sorry, that's too vague.

What is a root folder of the synchronization?

What about files in other (sub)folders (if there are any)? What about files in the synchronization root folder?

Reply with quote

DenimKnight
Guest

Re: synchronize local with include and exclude masks

Hi Martin,

Sorry about being vague, was trying to keep it general so that it other users in the same boat could benefit as well.

On the FTP Server

The FTP site gets updated daily, the files are stored in monthly folders (yyyyMM). There are no other sub folders. There is one folder on the FTP site that I want to exclude entirely which has the path (/sftp/file/000001) When the FTP user connects it defaults to folder path /sftp/file/.

Within each of the monthly folders there are various files, there are 4 file names that get repeated with different file extensions (ATM01.*, ATM02.*, AMT03.* and ATM04.*), there could be other file names in there that I don't want (eg ATM08.*) but I don't know for sure what they will be so I only want to include the files that start with the 4 names given with any file extension after that name. (eg ATM01.txt, ATM01.csv...etc).

On Local Machine

On the local machine the file path is H:\sftp\file\ and it should replicate the monthly folder structure.

So I want to synchronize from the Remote (FTP) server to the local machine based on the rules given above.

Is that enough information for you?
Hope you can help.

Thanks
Alex

Reply with quote

Advertisement

GiordanoMalik
Joined:
Posts:
1

How can we include a directory (with all files) and sub-directories (with all files)?

How can we include a directory (with all files) and sub-directories (with all files)?

I tried also this:
$transferOptions.FileMask = "*/Docs/*.*"
Also this:
$transferOptions.FileMask = "*/Docs/*"

Reply with quote

martin
Site Admin
martin avatar

Re: How can we include a directory (with all files) and sub-directories (with all files)?

@GiordanoMalik: All subdirectories will all files are included by default. If you have problems, we need more details about what are you trying to achieve. Please start your own question.

Reply with quote

Advertisement

You can post new topics in this forum