Topic "problem with filemask"

Author Message
asdad
[View user's profile]

Joined: 2012-06-12
Posts: 2
Hi

I'm trying to use command line winscp to copy a folder to a server, excluding svn files.
Code:

@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
Code:

%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)
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Correct file mask is |.svn/


%winscp% /console /command "option confirm off" "option batch on" "open mysite" "put -filemask=|.svn/ %localfolder% %remotefolder% " "exit"
asdad
[View user's profile]

Joined: 2012-06-12
Posts: 2
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):
Code:
Session started.
Active session [1] xxx
winscp>

Both versions work fine without filemask.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please post a complete batch file you use to run WinSCP.
_________________
Martin Prikryl
jadiagaurang
[View user's profile]

Joined: 2012-07-05
Posts: 1
Location: Los Angeles, CA
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.

Code:

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
GuestIV

Guest


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



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


Not tested so it might need some changing.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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 ...

http://winscp.net/eng/docs/scriptcommand_option
_________________
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