Topic "Winscp file to multiple servers / hosts"

Author Message
ananyboss

Guest


Hi,

I want to send a small file to 100 - 500 servers,
I am currently doing a winscp to each server, input username password every time !

Is their any way to automate it ?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Scripting:
https://winscp.net/eng/docs/scripting

You can upload the file with single line like:
winscp.com /command "open sftp://username@hostname/" "put c:\localfile /remotepath" "exit"
Just copy and paste this to a .bat file as many times as you need and just make sure you have correct hostname on every line.
_________________
Martin Prikryl
alex96

Guest


hi Martin,

I try to do it as you wrote below, but unfortunatelly not succed it, so obviously I am doing soemthing wrong.
Please help me with a concrete example, using following datas:

server1: myserver1.com username: username1@myserver1.com password: passw1 folder: root/folder1
server2: myserver2.com username: username2@myserver2.com password: passw2 folder: root/folder2
server3: myserver3.com username: username3@myserver3.com password: passw3 folder: root/folder3

page to be uploaded: C:\folder\example.html

thank you very much in advance.

Alex[/quote]
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Start here:
https://winscp.net/eng/docs/script_upload_multiple_servers
Jagadeesh

Guest


I am unable to resolve the user name & password issues.
I am trying to copy a file from my windows local machine remote linux machine which can be connected with a user name & pwd.
I have a batch file as below.

cd\
cd C:\Users\E002856\AppData\Local\WinSCP
WinSCP.com /script=C:\Users\E002856\ScrToCpFilesToMultLoc.txt

ScrToCpFilesToMultLoc.txt is the script file whose code is as below.
open sftp://userName:pwd@172.16.3.30/
put d:\examplefile1.txt /home/test-user/temp/
exit

When I try to execute the batch file, it's asking me to provide the username & pwd again where I provided in the script already.
I can able to execute this code manually with no issue.

Any ideas how to resolve this.
Thanks in Advance.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25966
Location: Prague, Czechia
Jagadeesh wrote:
I am unable to resolve the user name & password issues.
I am trying to copy a file from my windows local machine remote linux machine which can be connected with a user name & pwd.
I have a batch file as below.
...

Please start anew thread and attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
_________________
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