PUT command simultaneous transfers

Advertisement

nazran
Guest

PUT command simultaneous transfers

Forgive me for novice question.

I am using the following basic batch/script to copy 5 files to my FTP server.

option batch on
option confirm off
open FTPSERVER
option transfer binary
put D:\1.ZIP
put D:\2.ZIP
put D:\3.ZIP
put D:\4.ZIP
put D:\5.ZIP
exit

I am fairly sure WINSCP sends the 5 files 1 at a time in the order above. I looked around and I saw a few different posts about how to get WinSCP to transfer all 5 files at the same time but it is not working. Could someone give me the proper syntax to send all at same time?

Reply with quote

Advertisement

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

Re: PUT command simultaneous transfers

You would have to run 5 separate scripts in parallel.

You can use a batch file like this:

start "" winscp.com /command "open FTPSERVER" "D:\1.ZIP" "exit"
start "" winscp.com /command "open FTPSERVER" "D:\2.ZIP" "exit"
start "" winscp.com /command "open FTPSERVER" "D:\3.ZIP" "exit"
start "" winscp.com /command "open FTPSERVER" "D:\4.ZIP" "exit"
start "" winscp.com /command "open FTPSERVER" "D:\5.ZIP" "exit"

Though note that 5 parallel uploads are too much, that will hardly give you a better performance than 2-3.

---

For a different implementation, see:
https://winscp.net/eng/docs/library_example_parallel_transfers

Reply with quote

Nazran
Guest

Re: PUT command simultaneous transfers

Thank you for the correct syntax!

martin wrote:


Though note that 5 parallel uploads are too much, that will hardly give you a better performance than 2-3.

Sorry are you referring to bandwidth, server ram/cpu resources, or something I am not aware of? The servers are at a colo with burstable bandwidth to 1gb. My office (where they are transferred to) has 75mb down.

I have a small time frame that I need to transfer these files (8GB in totals for all 5 zips) is the reason I am trying to send them all at once versus 1 at a time.

Reply with quote

Nazran
Guest

Another follow up. I ran my original script to watch it today and apparently had a server connection break on the transfer. When it reconnects and I assume tries to resume the file it now says the file is in use. Anyway around this?

batch on
confirm off
In scripting you should not rely on saved sites, use this command instead:
open ftp://User:Pass@MYFTPSERVER/
Connecting to MYFTPSERVER ...
Connected
Starting the session...
Session started.
Active session: [1] FTPSERVER
transfer binary
D:\...\1.zip | 2398976 KB | 0.0 KB/s | binary | 54%
Lost connection.
Timeout detected. (data connection)
Copying files to remote side failed.
(A)bort, (R)econnect (0 s): Reconnect
Connecting to MYFTPSERVER ...
Connection failed.
Timeout detected. (control connection)
Connection failed.
(A)bort, (R)econnect (0 s): Reconnect
Connecting to MYFTPSERVER ...
Connected
Starting the session...
Session started.
D:\...\1.zip | 0 B | 0.0 KB/s | binary | 0%
Error transferring file 'D:\1.zip'.
Copying files to remote side failed.
The process cannot access the file because it is being used by another process.
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort
D:\...\2.zip | 3559884 KB | 2466.4 KB/s | binary | 100%
D:\...\3.zip | 1134432 KB | 2677.0 KB/s | binary | 65%

Reply with quote

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

Nazran wrote:

Another follow up. I ran my original script to watch it today and apparently had a server connection break on the transfer. When it reconnects and I assume tries to resume the file it now says the file is in use. Anyway around this?
It might by a local antivirus scanning the partially transferred file.

Reply with quote

Advertisement

You can post new topics in this forum