tags:

views:

467

answers:

1

I would like to optimize my scp deployment which currently copies all files to only copy files that have changed since the last build. I believe it should be possible with the current setup somehow, but I don't know how to do this.

I have the following:

Project/src/blah/blah/ <---- files I am editing (mostly PHP in this case, some static assets)

Project/build <------- I have a local build step that I use to copy the files to here

I have an scp task right now that copies all of Project/build out to a remote server when I need it.

Is it possible to somehow take advantage of this extra "build" directory to accomplish what I want -- meaning I only want to upload the "diff" between src/** and build/**. Is it possible to somehow retrieve this as a fileset in ANT and then scp that?

I do realize that what it means is that if I somehow delete/mess around with files on the server in between, the ANT script would not notice, but for me this is okay.

+1  A: 

I think you need to use rsync instead. I found the following article that answers your question.

In a nutshell rsync will resume where it left off and it should be possible to tunnel it over ssh.

Mark O'Connor