Getting ANT for scp only new / changed files

I would like to optimize my scp deployment, which currently copies all files only for copying files that have changed since the last build. I believe that this is possible with the current setup, but I do not know how to do this.

I have the following:

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

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

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

Is it possible to somehow use this additional "build" directory to do what I want - this means that I only want to load the "diff" between src / ** and build / **. Is it possible to somehow get this as a collection of files in ANT and then scp that?

I understand that this means that if I somehow delete / mess with the files on the server between them, the ANT script will not notice, but for me this is normal.

+5
source share
2 answers

You can specify to ant scpcopy only those files that have been changed since the last click using the tag modified:

<scp trust="true" sftp="true"... >
  <fileset dir="${local.dir}">
    <modified>
      <param name="cache.cachefile" value="localdev.cache"/>
    </modified>
  </fileset>
</scp>

, , , param. .

sftp.

+13

, rsync. , .

rsync , , ssh.

0

All Articles