scripting - exclude directory

Advertisement

TheCave
Joined:
Posts:
1

scripting - exclude directory

Hello,
i am trying to automate a transfer excluding a subfolder.
I read in the documentation that | is not supported in scripting.
I also read in another post of support a way to exclude a folder via batch passing a txt as paramenter, but with this solution a cannot initialize the connection.
How can i workaround the problem?

this is my batch where i suppose | not supported
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\Logs\FTP-download.log" /logsize=2*200M /ini=nul ^
/command ^
"open ftpes://user:password@ftpssite.com/ -certificate=""ed:0a:2d:01:d6:77:66:12:23:0f:3a:a0:d5:20:76:f7:a2:79:e6:19"" -rawsettings ProxyMethod=3 ProxyHost=""proxyaddress.net"" ProxyPort=10077 ProxyUsername=""username"" ProxyPassword=""password""" ^
"lcd C:\scambioDati" ^
"cd /scambioDati" ^
"get -filemask=*.xml -neweronly fromIungo | /scambioDati/fromIungo/backup/" ^
"get -filemask=*.ack -neweronly fromIungo | /scambioDati/fromIungo/backup/ " ^
"exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)

Method 2 via batch and txt file. cannot establish the connection
batch:
"C:\Program Files (x86)\WinSCP\Winscp.com" /script=C:\Jobs\settings2.txt /log="C:\Logs\FTP-testSubfolder2.log" /logsize=2*200M
txt:
open ftpes://username:password@ftpssite.com/ -certificate=""ed:0a:2d:01:d6:77:66:12:23:0f:3a:a0:d5:20:76:f7:a2:79:e6:19"" -rawsettings ProxyMethod=3 ProxyHost=""proxyaddress.net"" ProxyPort=10077 ProxyUsername=""username"" ProxyPassword=""password""
lcd "C:\scambioDati"
cd /scambioDati
get -filemask=*.xml -neweronly test|/scambioDati/test/subfolder/
get -filemask=*.ack -neweronly test|/scambioDati/test/subfolder/
exit

any help is very appreciated!
Matthew

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,791
Location:
Prague, Czechia

Re: scripting - exclude directory

This is the correct syntax:
 "get -filemask=*.xml|/scambioDati/fromIungo/backup/ -neweronly fromIungo" ^
 "get -filemask=*.ack|/scambioDati/fromIungo/backup/ -neweronly fromIungo" ^

Reply with quote

Advertisement

You can post new topics in this forum