Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

gcb-toronto

Re: Get remote path and file into local relative path

martin wrote:

Use get /* and exclude everything you do not want to transfer using -filemask=.


prikryl, thanks for pointing me in the right direction.

This is what I came up with:

winscp.exe /console /command "option confirm off" "open sftp://root:password@192.168.0.145" "get /root/MYFOLDER/test.txt" "close" "exit"

xcopy "test.txt" ".\root\MYFOLDER\" /Y
gcb-toronto

Re: Get remote path and file into local relative path

martin wrote:

Use get /* and exclude everything you do not want to transfer using -filemask=.


I am transferring a fixed set of files that are in various locations on the disk of a Linux computer. There are possibly hundreds of files that would need to be excluded. The point is to be able to specifically name the files that I want from the remote device. I don't think that excluding the files I do not want would be practical. Does WinSCP offer any better solutions?
martin

Re: Get remote path and file into local relative path

Use get /* and exclude everything you do not want to transfer using -filemask=.
gcb-toronto

Get remote path and file into local relative path

Hi all,

If my script is running from

C:\temp

I want to get remote file

/root/test.txt

into

C:\temp\root\text.txt

without also getting empty directories from under the remote directory.

How to do this? I have experimented with both get and synchronize and filemasks. I have gotten close, but not exactly what I want.

I was able able to do this under Linux using rsync and I am trying to do the equivalent under Windows.

gb