Topic "Sample Script to send files using SFTP WINSCP"

Author Message
vk.kumar
[View user's profile]

Joined: 2015-04-23
Posts: 4
Location: INDIA
Hi All,

Iam new to scripting. My requirement is as below:

Poll the files from a particular location and send to target location using SFTP (WINSCP).
Guide me writing a script for this requirement.

Thanks in Advance.
Krishna
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What specific problem are you having with the task? Where are you polling the files from? A local or remote location?
vk.kumar
[View user's profile]

Joined: 2015-04-23
Posts: 4
Location: INDIA
1. Files will be polled from local machine.
2. I need to transfer multiple files from local machine to remote SFTP location.

Could you provide sample script for the above requirement.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Just create a simple upload script and schedule it to run in regular intervals (or in a loop from a batch file).

See
https://winscp.net/eng/docs/guide_automation
https://winscp.net/eng/docs/guide_schedule
vk.kumar
[View user's profile]

Joined: 2015-04-23
Posts: 4
Location: INDIA
Thanks for the update.

what should be given in the hostkey value.

open sftp://user:password@example.com/ -hostkey=""
Hema

Guest


If you are using 5.7.2. version, click 'Session' tab in the Menu, then click 'Server/Protocol Information'. 'Server host key fingerprint' can be seen at the bottom of the 'Protocol' screen.
vk.kumar
[View user's profile]

Joined: 2015-04-23
Posts: 4
Location: INDIA
thanks for update.

we are using WINSCP 4.3.2 version. I couldn't able to find the option which you were telling.


open sftp://user:password@example.com/ -hostkey=""

do we need to give the private key in the hostkey value??.


Regards,
Kumar
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
See https://winscp.net/eng/docs/faq_hostkey

In 4.3.2, the command in is Commands menu.
Though you SHOULD NOT use 4.3.2. You need to upgrade!
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