atp03
atp03

Reputation: 3699

Windows Command Line FTP to deploy website

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

Upvotes: 1

Views: 2159

Answers (2)

Frank N
Frank N

Reputation: 10416

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

Upvotes: 0

rojo
rojo

Reputation: 24476

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.

Upvotes: 4

Related Questions