Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Unknown switch 'filemask'.

jadiagaurang wrote:

But, It gives me error saying that Unknown switch 'filemask'.

If you are using 4.3.8, use
option exclude ...
or
option include ...

https://winscp.net/eng/docs/scriptcommand_option
GuestIV

Filemask switch only works in the version 5 beta. Use quotation marks.



Try:
put -include="* |.svn/ %1%\*"


Not tested so it might need some changing.
jadiagaurang

Unknown switch 'filemask'.

I have same requirements. I want to ignore .svn directories from my local directory to remote directory.

Here is my deploy script. Let me know what I am missing here.

option batch abort

option confirm off

open ftp://%3%:%4%@%2%

put -filemask=|.svn/ %1%\*

exit


But, It gives me error saying that Unknown switch 'filemask'.

Thanks,
Gaurang
martin

Please post a complete batch file you use to run WinSCP.
asdad

Hi

Thanks for the reply
However, still doesnt seem to be working. Tried adding the filemask to both your and my version of the command, but it still ignores ALL files as soon as I do so.
Last lines of console (when I remove the exit command):
Session started.

Active session [1] xxx
winscp>

Both versions work fine without filemask.
martin

Re: problem with filemask

Correct file mask is |.svn/


%winscp% /console /command "option confirm off" "option batch on" "open mysite" "put -filemask=|.svn/ %localfolder% %remotefolder% " "exit"
asdad

problem with filemask

Hi

I'm trying to use command line winscp to copy a folder to a server, excluding svn files.
@echo off

set winscp="c:\Program Files (x86)\winscp\winscp.exe"

...

%winscp% mysite /console /command "option confirm off" "put -filemask=.svn %localfolder% %remotefolder% " "exit"

No matter what I set the filemask to, no files get uploaded (things work fine without the filemask, so never mind the tokens).

Ideally, I would like to exclude everything beginning with "." - I tried .* as filemask, is that right?


I also tried
%winscp% mysite  /console /command "option confirm off" "option exclude .svn" "put %localfolder% %remotefolder% " "exit"

it seems to recognize the option - console prints "confirm off, include |.svn"
So exclude turns to include and again nothing gets uploaded

Using latest version 5.0.7 (build 2268)