Windows Command Line FTP to deploy website

2019-06-10 06:27发布

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

2条回答
你好瞎i
2楼-- · 2019-06-10 06:56

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.

查看更多
该账号已被封号
3楼-- · 2019-06-10 07:07

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

查看更多
登录 后发表回答