Windows Command Line FTP to deploy website

百般思念 提交于 2019-12-08 12:55:19

问题


Trying to set up a post build script on my CI server to push changes to our web server by FTP. In as few lines as possible how can i push a folder of files to my webserver using windows FTP? For example deployment folder is:

c:\deployment\*.*

How can i recursively push all files to replace on the web server?

I'm open to using cmd or powershell - MS Windows only

Thanks


回答1:


Windows' built-in command-line FTP client doesn't have recursion built-in. The easiest way would be to use a different FTP client. NcFTP will do what you're looking for. See the manual page for ncftpput. The syntax is basically as follows:

cd c:\deployment
ncftpput -u user -p pass -R ftp.ftpserver.com /path/on/ftp/server .\*

Or if your web server also runs an ssh service, then rsync would be even better.




回答2:


Fsync is good, I am using it for long. It allows to push only what has changed. Recursion of course. Exclude files, too. Track client-side (much faster) what has changed... Biggest only drawback: No SFTP./ProductList/Fsync.html



来源:https://stackoverflow.com/questions/14630932/windows-command-line-ftp-to-deploy-website

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