Copy files from SFTP with CMD

拈花ヽ惹草 提交于 2019-12-13 09:37:27

问题


We have a customer with their SFTP site, and I would like to copy files from specific folder, by using any automated process.

One of the example which I found, is winscp.net, but I have not managed how to use it, for my purpose. http://www.itworld.com/article/2928599/windows/how-to-automate-sftp-file-transfers-in-microsoft-windows.html

QUESTION: All I will need is not run script and the file should be copied from their directory to my local folder. Is it possible at all?

I found the way of using PSFTP(Putty) to connect to the server, but how to make it automatically, do not know.


回答1:


I think its a good solution for your problem.

You have to install winscp and the code some files and it will do automaticaly. I used 3 or 4 times. Also you need the key for your SFTP to connect throught it.

Here a link to the guide step by step.

https://winscp.net/eng/docs/guides

Here is a link to the scripting webpage

https://winscp.net/eng/docs/scripting

I recommend you to create an ini file to load all of the characteristics of your ftp connection and then execute an script over this.

It can be launched like that

WinSCP.com /ini=[your ini file] /script=[Your script file(what you want to do when it is connect)]

Hope this helps!.



来源:https://stackoverflow.com/questions/40911751/copy-files-from-sftp-with-cmd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!