Windows命令行FTP部署网站 [英] Windows Command Line FTP to deploy website
问题描述
尝试在我的CI服务器上设置一个后构建脚本,以通过FTP将更改推送到我们的Web服务器。在尽可能少的行如何可以推送一个文件夹的文件到我的网络服务器使用Windows FTP?例如部署文件夹是:
c:\deployment\ *。*
如何递归推送所有文件以在网络服务器上替换?
m打开以使用cmd或powershell - 仅限MS Windows
感谢
解决方案Windows的内置命令行FTP客户端没有内置递归。最简单的方法是使用不同的FTP客户端。 NcFTP 可以满足您的要求。请参阅 ncftpput的说明书。语法基本如下:
cd c:\deployment
ncftpput -u user -p pass -R ftp.ftpserver.com / path / on / ftp / server。\ *
服务器还运行ssh服务,那么
rsync
会更好。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
解决方案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.这篇关于Windows命令行FTP部署网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!