Topic "PUT command simultaneous transfers"

Author Message
nazran

Guest


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?
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
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
Nazran

Guest


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.
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%
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
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.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License