[SOLVED] Problem with filemask/exclude

Advertisement

grefabu
Joined:
Posts:
2

[SOLVED] Problem with filemask/exclude

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
Last edited by grefabu on 2021-06-15 11:48; edited 1 time in total

Reply with quote

Advertisement

grefabu
Joined:
Posts:
2

Hi,

this work, sureley.
And now I recognize why I didn't see the filemask in the log file: I've a mask in front of my eyes, the log will not override instead it is an cating to the exist, I've to scroll down.

There are two spelling on german for my situation:
Tomaten auf den Augen
Kaum macht man's richtig, schon funktionierts

Thank you!

Gregor

Reply with quote

Advertisement

You can post new topics in this forum