Topic "Exclude files from download via filemask"

Author Message
AlLeX_
[View user's profile]

Joined: 2012-10-11
Posts: 13
Hello,

I am getting all files from a SFTP server with a script but I have te exclude a certain file type from download. For example *temp files.

Thanks a lot for your help
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Use a -filemask switch of get command:
http://winscp.net/eng/docs/scriptcommand_get
_________________
Martin Prikryl
AlLeX_
[View user's profile]

Joined: 2012-10-11
Posts: 13
Thank you very much for your answer.


Is there a possibilty to exclude a file via its suffix with -filemask switch? This is not mentioned in the documentation.

For exaple: I have to download all files except those with *.tmp sufix.

-delete -filemask <> *.tmp (this does not work) - something like this ?
AlLeX_
[View user's profile]

Joined: 2012-10-11
Posts: 13
I have Found it!!

-filemask *.*|*.tmp

This works!

Thank you once again
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
That's correct, just that you can omit the leading *.* actually and use just |*.tmp.

You have also omitted the "equal sign", but I assume you actually use it, otherwise it cannot work.

The correct and simplest syntax is -filemask=|*.tmp.
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