2

I've always used WinSCP to keep my localhost and the server syncronized while I'm working on a project and it has always worked as expected.

This is the .lnk file I've always used

"C:\Program Files (x86)\WinSCP\WinSCP.exe" "Typed" /defaults /keepuptodate // "C:\Xampp\htdocs\my\folder\path" /my/server/path

Now I have to exclude .txt files, because WinSCP causes the logs on my host to be deleted (they are updated on the server but remain blank on localhost, so the sync function deletes them when I open the file).

Reading the documentation I found this solution:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" "Typed" /defaults /keepuptodate // "C:\Xampp\htdocs\my\folder\path" /my/server/path /parameter // "-filemask=|*.txt"

The problem is that now every time I open the link I get this message:

WinSCP error

It never happened before:

  • If I click on "yes", it does a full syncronization of every single file, even if they are already identica
  • If I click "no" it does not syncronize anything, and if I change a file it starts syncing the whole folder

What am I doing wrong?

1 Answer 1

1

There's no -filemask command-line switch.

You have to use raw transfer settings IncludeFileMask:

/rawtransfersettings IncludeFileMask="|*.txt"

Note that you use the // (swo slashes). No switches work after //. So either put the /rawtransfersettings before the //. Or remove the //, unless it is really needed. It's needed if your path looks like a switch (/path), but not when it's clearly a path (/my/server/path).

1
  • 1
    Solved! As you said in the email, the // before the switch escaped it and caused that error.
    – user13327421
    May 4, 2020 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy