Hi,
there are several threads about exclude subfolders when download a folder structure.
But I've a additional question:
I want to write an batch file for sheduled task:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\SCRIPT\WINSCP/backup.log" /command "open sftp://USER@HOST/ -hostkey=""ssh-ed25519 255 2EoAW+4XY0jeOEv5I6lXIqpWbPH2zR3npd/5IUOx1qY="" -privatekey=""C:\SCRIPT\WINSCP\id_rsa.ppk"" -passphrase=""PASS""" "get / D:\Backup\" "exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%
This work so far, but one subfolder is read protected and WinSCP exit.
I don't now how I ignore the error so I want to exclude the subfolder with the
-filemask
property adding
--filemask=|*/postgresdumps/
:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\SCRIPT\WINSCP/backup.log" /command "open sftp://USER@HOST/ -hostkey=""ssh-ed25519 255 2EoAW+4XY0jeOEv5I6lXIqpWbPH2zR3npd/5IUOx1qY="" -privatekey=""C:\SCRIPT\WINSCP\id_rsa.ppk"" -passphrase=""PASS""" "get / D:\Backup\"" -filemask=|*/postgresdumps/" "exit"
When that doesn't work I wonder and I've a look in the log file.
And now the really unsuspected: In the command written down to the log the Parameter didn't appear. I tried it with several changes, but in in the log file I found nothing about filemask,...
Then I've tried it with an scp script and the same behavior, the script works, but no filemask entry.
Why I get this behavior? And is there another way to prefend the break on permission denied?
Bye
Gregor