Can't exclude directories in command line

Advertisement

Elwood
Guest

Can't exclude directories in command line

Hi,

I really can't understand from the manual, how to exclude a directory. :-(
I'm using WinSCP 6.3.1.14821 on Win2022.

I have a FTP server containing:
/mydir
/mydir/myfile.txt
...
On my local machine, I cd into a directory and call the following to synchronize everything except mydir completely:
WinSCP.com ftp://user:password@ftp.domain.com  /command "synchronize local . /" -filemask "|mydir/" exit
It still downloads mydir, even if I use |/mydir/.
Even WinSCP dialog generates such filemask so what is the filemask I should use?

Output is:
Synchronizing...
Local '.' <= Remote '/'
mydir                  |            0 B |    0,0 KB/s | binary |   0%
other files...
Thanks.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Can't exclude directories in command line

You are missing an equal sign. And you also have quotes wrong.
It should be:
"synchronize local . / -filemask=|mydir/"
If this does not help, please post session log file.

Reply with quote

Elwood
Guest

may I suggest to add scripting examples?
I mean in docs/scriptcommand_synchronize, it gives only the command which is
synchronize both d:\www /home/martin/public_html
so it doesn't help to understand how this command should be used in the command line.
This is why I didn't understand about the quotes.

If you add such example, it would easier to get the idea:
WinSCP.com /command "synchronize both d:\www /home/martin/public_html" exit

Reply with quote

Advertisement

You can post new topics in this forum