Download order ??

Advertisement

Guest

Download order ??

Hi, I'm using Winscp to 'get -delete' all files and directories from one server and copy to another server using a batch file which uses parses parameters to a .conf file. The order in which the files are copied appears to be completely random. Typically most programs will copy in alphabetical order. How does Winscp determine the order in which to copy? Is there anyway to make Winscp copy in alphabetical order?

This is an example of the order in which winscp is copying.
20150302_123851.mkv
20150302_104348.mkv
20150302_131852.mkv
20150302_133353.mkv
20150302_102356.mkv


Here are my script files.

#batch file contents

winscp.com" /xmllog="C:\Logs\log.xml" /loglevel=0 /script=C:\WinSCP\winscp.conf /parameter 192.168.2.1 /media/path1 \\172.16.1.120\path2\


#winscp.conf contents

option batch continue
open sftp://user:pass@%1%/ -timeout=60 -rawsettings SendBuf=0
option confirm off
get -delete -resume %2%/*.* %3%
close
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Re: Download order ??

As most programs, WinSCP downloads the files in the order as they are presented by the server.
_________________
Martin Prikryl

Reply with quote

Guest

Re: Download order ??

Hi Martin, thank you for your reply. What I am trying to achieve is downloading the files in the correct order. One workaround I thought of was using multiple get commands with wild cards, to match files in the correct order (e.g. *_00*.mkv, *_01*.mkv etc)

The files I need to copy are a few levels down and the interim folders are variable. e.g.

/media/path1/variable1/variable2/20150302_003851.mkv \\172.16.1.120\path2\variable1\variable2\

I've tried using the following and a few other variations, but it does not work:

get -delete /media/path1/*/*/*_00*.mkv \\172.16.1.120\path2\

If I use the full path it works:

get -delete /media/path1/variable1/variable2/*_00*.mkv \\172.16.1.120\path2\variable1\variable2\

Is there anyway I can give wildcard for the interim folders?

Reply with quote

Guest

Re: Download order ??

Disregard, I figured out how to do this:

get -delete -resume -filemask=*_00*.mkv %2% %3%
get -delete -resume -filemask=*_01*.mkv %2% %3%
get -delete -resume -filemask=*_02*.mkv %2% %3%

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Re: Download order ??

That's correct. Thanks for sharing your solution.

Reply with quote

Advertisement

You can post new topics in this forum