Re: Synchronize remote with local and exclude subdirectories
Oh my, Mr Hawkeye himself to notice that! It work's really great now! As always, huge thanks for your help, Martin!
*
should not be there:
"synchronize remote -delete -nopermissions -transfer=binary -filemask=""|*/""" ^
. 2017-10-27 06:09:47.106 Asking user:
. 2017-10-27 06:09:47.106 Fel uppstod när listning av katalog '*'. ("Fel vid hämtning av fillista för ""*\*.*"".","Systemfel. Kod: 123.","Felaktig syntax för filnamn, katalognamn eller volymetikett")
< 2017-10-27 06:09:47.106 Script: Fel uppstod när listning av katalog '*'.
< 2017-10-27 06:09:47.106 Script: Fel vid hämtning av fillista för "*\*.*".
< 2017-10-27 06:09:47.106 Systemfel. Kod: 123.
< 2017-10-27 06:09:47.106 Felaktig syntax för filnamn, katalognamn eller volymetikett
< 2017-10-27 06:09:47.107 Script: Fel uppstod när listning av katalog '*'.
< 2017-10-27 06:09:47.107 Fel vid hämtning av fillista för "*\*.*".
< 2017-10-27 06:09:47.107 Systemfel. Kod: 123.
< 2017-10-27 06:09:47.107 Felaktig syntax för filnamn, katalognamn eller volymetikett
. 2017-10-27 06:09:47.107 Script: Failed
. 2017-10-27 06:09:47.107 Script: Exit code: 1
. 2017-10-27 06:09:47.107 Kopplar ifrån server
"lcd C:\A\" ^
"synchronize remote -delete -nopermissions -transfer=binary -filemask=""|*/"" * ^
^
's are the very last characters on their respective lines (there cannot be any space after them).
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="F:\skrivbord\log\WinUPP.log" /ini=nul ^
/command ^
"open ftp://USER:PASSWORD@IP:PORT/ -passive=0" ^
"cd /DIR/A/" ^
"lcd C:\A\" ^
"synchronize remote -delete -nopermissions -transfer=binary -filemask=""|*/"" * ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="F:\skrivbord\log\WinUPP.log" /ini=nul ^
/command ^
"open ftp://USER:PASSWORD@IP:PORT/ -passive=0" ^
"cd /DIR/A/" ^
"lcd C:\A\ ^
"synchronize remote -delete -nopermissions -transfer=binary -filemask="|*/" * ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%
winscp.com /command ^
"open ftp://USER:PASSWORD@IP:PORT/ -passive=0" ^
...
/DIR
-> /A
-> /B
-> /C
A
, B
and C
from being synchronized.
/DIR
that I also would like to be excluded from being synchronized. Just files in /A/
, /B/
and /C/
. I don't want to accidentally delete files or folders on either local or remote.
"open ftp://USER:PASSWORD@IP:PORT/ -passive=0" ^
"cd /DIR/A/" ^
"lcd C:\A\ ^
"synchronize remote -delete -nopermissions -transfer=binary -filemask="|*/" * ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%