适用于 Windows 的最佳免费脚本 SFTP 客户端是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/937579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's the best free scriptable SFTP client for windows?
提问by Chris
What's the best free scriptable SFTP client for windows?
适用于 Windows 的最佳免费脚本 SFTP 客户端是什么?
I've looked at WinSCP and FileZilla. WinSCP seems quite buggy (click here), and FileZilla doesn't seem very scriptable.
我看过 WinSCP 和 FileZilla。WinSCP 似乎有很多问题(单击此处),并且 FileZilla 似乎不太适合编写脚本。
Any suggestions?
有什么建议?
Basically what I want to do is: from a scheduled task, log onto a remote server, pull any files across, and then delete them from the remote server.
基本上我想做的是:从计划任务登录到远程服务器,拉取所有文件,然后从远程服务器中删除它们。
采纳答案by Janusz
You can use the scp client that comes with putty pscp. You can use pscp on the command line like scp in a linux command line.
可以使用putty pscp自带的scp客户端。您可以在命令行上使用 pscp,就像在 linux 命令行中使用 scp 一样。
回答by Pablo Santa Cruz
回答by Ashley Davis
Putty scp has already been mentioned.
Putty scp 已经提到过。
I want to mention putty psftp.exe which might be new.
我想提一下 putty psftp.exe,它可能是新的。
Use the following command line:
使用以下命令行:
psftp.exe -l -pw -b
psftp.exe -l -pw -b
This will log into the ftp server and run file-with-ftp-cmdsagainst it.
这将登录到 ftp 服务器并对其运行file-with-ftp-cmds。
Full docs here:
完整文档在这里:
http://the.earth.li/~sgtatham/putty/0.52/htmldoc/Chapter6.html
http://the.earth.li/~sgtatham/putty/0.52/htmldoc/Chapter6.html
回答by Jan Ehrhardt
I know this is a very old question, but take a look at http://redpark.posterous.com/lftp-for-windows
我知道这是一个非常古老的问题,但请查看 http://redpark.posterous.com/lftp-for-windows
From cygwin I am using only 3 files: bash.exe, ssh.exe and cygssp-0.dll. Put them in the same directory as redpark's Windows port of lftp and go scripting.
在 cygwin 中,我只使用了 3 个文件:bash.exe、ssh.exe 和 cygssp-0.dll。将它们放在与 redpark 的 lftp 的 Windows 端口相同的目录中,然后编写脚本。
Commandline example:
命令行示例:
D:\lftp>bash
bash-4.1# export PATH=.
bash-4.1# lftp sftp://user:[email protected]
lftp [email protected]:~> put -c cx160sd.flv
194749860 bytes transferred in 112 seconds (1.67M/s)
lftp [email protected]:/> exit
bash-4.1# exit
exit
D:\lftp>
It is no single exe solution, but uploads proved to be twice as fast as uploads by pscp.exe
这不是单一的 exe 解决方案,但事实证明上传速度是 pscp.exe 上传速度的两倍
Edit: new URL now posterious has stopped: http://envelopepushing.wordpress.com/2010/08/24/lftp-for-windows/
编辑:现在后继的新网址已停止:http: //envelopepushing.wordpress.com/2010/08/24/lftp-for-windows/
回答by Joe K
You could check out SecureFX by VanDyke. http://www.vandyke.com/products/securefx/
您可以查看 VanDyke 的 SecureFX。 http://www.vandyke.com/products/securefx/
or MKS Toolkit for Sys Admins http://mkstoolkit.com/products/tk/ds_tkother.asp
或系统管理员的 MKS 工具包 http://mkstoolkit.com/products/tk/ds_tkother.asp
回答by Bruce Blackshaw
Not free, but look at edtFTPnet/PROfor a comprehensive script engine that supports SFTP on Windows.
不是免费的,但请查看edtFTPnet/PRO以获得在 Windows 上支持 SFTP 的综合脚本引擎。
Here's a sample script:
这是一个示例脚本:
# Sample SFTP script
set remotehost=edtmobile
set user=javaftp
set password=javaftp
set protocol=sftp
set localdir=D:\work\tmp
# connect to the server
open
# change dir
cd remote/test
# put the local file test.txt to the server as mytest.txt
put test.txt mytest.txt
# disconnect
close
回答by Andrew
Note to others: To create the scheduled task, simply open a text editor and write out the pscp command. Then save the file as a .bat file. Chapter 5 and 6 of the documentation have everything you'd ever want to know about how pscp works.
其他人注意:要创建计划任务,只需打开文本编辑器并写出 pscp 命令。然后将文件另存为 .bat 文件。文档的第 5 章和第 6 章包含您想了解的有关 pscp 工作原理的所有信息。
Note that pscp is quite particular about having a source and a target. If you don't provide those, pscp will simply default back to the usage message.
请注意,pscp 非常注重拥有源和目标。如果您不提供这些,pscp 将简单地默认返回使用消息。
Here's an example:
下面是一个例子:
c:\pscp.exe -pw [your password] -batch -sftp [email protected]:/* c:\yourlocation
In this example pscp.exe is sitting in the root of th c directory. -batch disables interactive prompts so that they won't interrupt the automated task. -sftp forces the sftp protocol, because in the question sftp is specified. The :/* wildcard will bring back everything in the source, and the c:\yourlocation specifies where it ends up on your machine.
在本例中,pscp.exe 位于 c 目录的根目录中。-batch 禁用交互式提示,以便它们不会中断自动化任务。-sftp 强制使用 sftp 协议,因为在问题中指定了 sftp。:/* 通配符将带回源中的所有内容,而 c:\yourlocation 指定它在您的机器上的最终位置。
To schedule this as an automated task, simply bring up Scheduled Tasks. In XP, this is in System Tools. Then point the task to the .bat file you've created, give it a time to run, and you're set.
要将其安排为自动任务,只需调出计划任务。在 XP 中,这是在系统工具中。然后将任务指向您创建的 .bat 文件,让它运行一段时间,然后就完成了。
回答by Ghost
Rush FTP; free, comes in portable versions and has a comprehensive scripting API (compatible with LUA language).
加急FTP;免费,有可移植版本,并具有全面的脚本 API(与 LUA 语言兼容)。
回答by eric
If you work with powershell you can use something like netcmdlets (www.netcmdlets.com). It is not a client per-se, but a set of libraries (cmdlets) for internet communications. There is a free personal edition as well. It's easy to configure schedules tasks to call powershell script and you have the benefit of being completely flexible/extensible through code.
如果您使用 powershell,您可以使用类似 netcmdlets (www.netcmdlets.com) 的东西。它本身不是客户端,而是一组用于 Internet 通信的库 (cmdlet)。还有免费的个人版。配置调度任务以调用 powershell 脚本很容易,并且您可以通过代码获得完全灵活/可扩展的好处。