ZipSync will sync the deltas of a zip file over a ssh connection.
It was developed at Sun Microsystems in 2008 to speed up the build - deploy - test cycle for a team of widely distributed Java CAPS programmers. JCAPS often produces .ear (a .zip file) files over 25MB, which would take a long time to upload just for one little change. Using ZipSync compares the local .ear file contents to the remote file, and updates the remote file, then kicks off a deploy command on the remote server.
Where to use
- If you are always uploading or downloading a zip file that is almost the same each time ZipSync can speed up that process.
- When you can make a ssh connection to the remote machine.
- When one of the machines is Unix based.
How it Works
- ZipSync is a .jar file, that you execute on your local machine.
- A ssh connection is made to the remote machine (the remote machine must be unix based, local machine can be unix or windows) - no remote setup is needed, just ssh access is required.
- If ZipSync doesn't exsit on the remote machine or it's out of date, a copy of the .jar file is uploaded to the remote machine.
- ZipSync is started on the remote machine on the ssh connection - where the standard in and out are on the ssh connection so the local and remote instances of ZipSync can talk with each other.
- The file sizes and checksums of the files in the local zip file are sent to the remote server.
- The remote compares the file sizes and checksums of the local to the remote version of the file and generates a list of deltas.
- The local is given the list of deltas and sends any files to the remote that are needed.
- The remote generates a temporary zip file using either content from it's zip file or the deltas that it was sent.
- Once the temporary zip file is complete the old zip file is overridden
- Optionally the remote can run a command that to do something with the new zip file.
ZipSync can also be used in reverse - where a remote zip file is synced to a local zip file.
If the remote zip file does not exist, the whole file will be uploaded - however this is a little slower than a regular copy, as the zip file contents are sent uncompressed.
For more information, send
Source code is in a subversion repository and can be checked out or browsed. It is a standard netbeans project.