Thanks for your help, I had to correct some spaces in the path but it works now. Just need to tweak it to be more specific. It's pulling more files than I want.
- fiyapondat
synchronize
command. I've updated my previous post.
^
at the open
line. And you do not have spaces at the front of the synchronize
line. And you are missing exit
command. And you still have the quotes wrong.
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://blah :blah blah@files.blackbaudhosting.com/ -hostkey=""blah blah blah="" -rawsettings CacheDirectories=0 CacheDirectoryChanges=0" ^
"synchronize -filemask=17087dm*1_compressed.bak local ""E:\ProgramFiles\MicrosoftSQLServer\MSSQL13.MSSQLSERVER2016\MSSQL\Backup"" ""/production/17087/backup/""" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause
exit /b %WINSCP_RESULT%
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://blah :blah blah@files.blackbaudhosting.com/ -hostkey=""blah blah blah="" -rawsettings CacheDirectories=0 CacheDirectoryChanges=0" ^
"synchronize -filemask=17087dm*1_compressed.bak local "E:\ProgramFiles\MicrosoftSQLServer\MSSQL13.MSSQLSERVER2016\MSSQL\Backup" "/production/17087/backup/" ^
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause
exit /b %WINSCP_RESULT%
"synchronize -filemask=17087dm????1_compressed.bak local "E:\ProgramFiles\MicrosoftSQLServer\MSSQL13.MSSQLSERVER2016\MSSQL\Backup" "/production/17087/backup/" ^
"Program Files"
, not in your blah
example), then it must be:
"synchronize -filemask=17087dm????1_compressed.bak local ""E:\blah\blah\blah"" ""/blah/blah/blah""" ^
"synchronize -filemask=17087dm????1_compressed.bak local E:\blah\blah\blah" "/blah/blah/blah" ^
"synchronize -filemask=17087dm*1_compressed.bak local E:\blah\blah\blah" "/blah/blah/blah"
-filemask
switch?
"synchronize -filemask=*.txt local E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER2016\MSSQL\Backup /production/90872/backup/" ^
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://unknkown:VFLx98u3g@files.insighthosting.com/ -hostkey=""ssh-rsa 1024 c36bXCOIuJJlXQcAxy3DLz+UYidT6Ylhfjdk4syUk="" -rawsettings CacheDirectories=0 CacheDirectoryChanges=0" ^
"synchronize local E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER2016\MSSQL\Backup /production/90872/backup/" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause
exit /b %WINSCP_RESULT%