I want to automate copying files from a dev environment to a unix server.
When using ANT’s SCP task, how does it handle synchronizing the directories?
I would like to ensure that:
- Files that are no longer in my source are removed from the destination server
- Files that didn’t change should not be copied (it would take forever to fully sync every jar file every time).
scpis the wrong tool for the task. Tryrsyncinstead.--deletewill delete stuff that’s no longer on the source side. Unmodified files are not copied; in fact,rsyncwill only copy those parts of existing files that did change (so it’s even faster for partially modified files like log files which have been appended to).