Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Net-SSH-W32Perl hanging

by tokpela (Chaplain)
on Feb 12, 2009 at 09:12 UTC ( #743251=note: print w/ replies, xml ) Need Help??


in reply to Net-SSH-W32Perl hanging

Hi Scrat,

You should use Net::SSH2 for SFTP on Windows. There is a PPM available for this module.


Comment on Re: Net-SSH-W32Perl hanging
Re^2: Net-SSH-W32Perl hanging
by Scrat (Monk) on Mar 20, 2009 at 11:51 UTC

    Thanks for the reply. Although the suggested module didn't work for me I managed to find something in the end that should satisfy the requirement:

    Requirement: Periodically scan a directory on a Windows Server and compile a list of xml files if there are any present. SFTP that list of files to a destination SFTP server. Once the transfer is successful remove them from the local server.

    This thread got me thinking about using a simple WinSCP script to do the file transfer.

    Using WinSCP Version 4.1.8 (which supports Hostkey validation during the authentication process with the -hostkey option) I built the following script:

    option batch on option confirm off open sftp://user:password@servername:22 -hostkey="hostkey" lcd d:\localdir cd /remotedir option transfer binary put *.xml close exit

    In the end a Windows Service will periodically scan a directory. During each iteration, should we find any xml files, we will call the above script to connect and transfer the files. If the transfer is successful the xml files will be removed locally afterwards.

    There are still some loopholes that would need to be resolved, like securing the script (encryption maybe?), more efficient error checking during the actual transfer, to name but a few. I'm still considering some ideas.

    Scrat

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://743251]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-10-23 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls