Topic "Uploading multiple files with script"

Author Message
Ulrike

Guest


Hi,

im uploading multiple files via script to one SFTP server. Each file is done with one script. After uploading 5 files (running 5 scripts) the login to the server is not possible for the next 2 or 3 minutes.

<--- SNIP
option batch on
option confirm off
open sftp://<user>:<pw>@<ip>:<port>
session
option transfer binary
put <file>
exit
--> SNAP

Any suggestions?

Regards,

Ulrike
Advertisements
RickB
[View user's profile]

Joined: 2006-12-12
Posts: 2
Location: Australia
Ulrike wrote:
Hi,

im uploading multiple files via script to one SFTP server. Each file is done with one script. After uploading 5 files (running 5 scripts) the login to the server is not possible for the next 2 or 3 minutes.

<--- SNIP
option batch on
option confirm off
open sftp://<user>:<pw>@<ip>:<port>
session
option transfer binary
put <file>
exit
--> SNAP

Any suggestions?

Regards,

Ulrike


The simplest (but not most elegant) solution is to list all files in the one script:

option batch on
option confirm off
open sftp://<user>:<pw>@<ip>:<port>
session
option transfer binary
put <file1>
put <file2>
put <file3>
put <file4>
put <file5>
put <file6>
put <file7>
exit

But why don't you use a wildcard instead? For example, if all the files you are uploading share the same extension (for example .txt) you could do this:

put *.txt

There are other examples here:
https://winscp.net/eng/docs/scriptcommand_put
Ulrike

Guest


Hi,

thanks for the reply.

The reason for uploading the files one by one is to make sure that every and each file suceeded. Im writing the script for the upload from code. And I can only get the return code from the whole script (as far as I know). As there are multiple formats files in multiple destinations wildcards wont work. Sad

Any suggestions? Is this a known behaviour?

Regards,

Ulrike
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Ulrike wrote:
im uploading multiple files via script to one SFTP server. Each file is done with one script. After uploading 5 files (running 5 scripts) the login to the server is not possible for the next 2 or 3 minutes.

It seems like you have some connection limit set on your server.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

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