Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Latest commit cb28360 @gianm Fix off-by-one
Failed to load latest commit information.
autotools First round of changes from Dennis Schridde <>, imp…
doc Merge branch 'master' into zsync_y
librcksum Merge branch 'master' into zsync_y
libzsync Fix segfault on missing "Filename:" from .zsync file
zlib Merge branch 'master' into zsync_y
INSTALL Bump versions numbers in docs to 0.6. Switch to autoreconf for making autotools files.
NEWS Seed file reading optimisations.
README Switch to autoreconf for making autotools files.
base64.c Duncan Mac-Vicar <> pointed out that base64.c was mi…
check-zsyncmake Fix check-zsyncmake.
client.c Merge branch 'master' into zsync_y Fix --disable-profile.
format_string.h %llu is incorrectly treated as (long int) on bsd4, switch everyone to…
getaddrinfo.c Add global header file to wrap/extend config.h (from Dennis Schridde).
getaddrinfo.h Add global header file to wrap/extend config.h (from Dennis Schridde).
http.c Fix off-by-one
http.h Add -R (ssl client certificate) and -S (private key) command line opt…
make.c Exit with error if given a truncated .gz file.
makegz.c Code indentation cleanup and better explanatory comments on the clien…
makegz.h Update copyright notices.
progress.c Code indentation cleanup and better explanatory comments on the clien…
progress.h Update copyright notices.
url.c Replace zsync's http client with libcurl.
url.h Replace zsync's http client with libcurl.
zsglobal.h Update copyright notices.


zsync 0.6.2

zsync is a file transfer program. It allows you to download a file from a
remote web server, where you have a copy of an older version of the file on
your computer already. zsync downloads only the new parts of the file. It uses
the same algorithm as rsync.

zsync does not require any special server software or a shell account on the
remote system (rsync, in comparison, requires that you have an rsh or ssh
account, or that the remote system runs rsyncd). Instead, it uses a control
file - a .zsync file - that describes the file to be downloaded and enables
zsync to work out which blocks it needs. This file can be created by the admin
of the web server hosting the download, and placed alongside the file to
download - it is generated once, then any downloaders with zsync can use it.
Alternatively, anyone can download the file, make a .zsync and provide it to
other users (this is what I am doing for the moment).

The zsync web site is at . There are likely to be
frequent releases, so check back often.


See the file INSTALL for instructions on compiling and (optionally) installing

As zsync is still at a very early stage, you may prefer not to install it, and
to run the program where you compile it. It will work fine that way - it has no
data files or libraries. The man(1) program on some systems will let you read
the man pages without installing them, e.g. man -l doc/zsync.1 .

zsync is free software. There is no implied support, no implied fitness for
purpose, no warranty. You use it at your own risk.


In its simplest form, as an end-user:


Someone has to make a .zsync file for the download before you can use zsync. As
zsync has not been around long, there won't be many such downloads around :-).
And you have to have an older copy of the file around, otherwise there is
little point in using zsync - zsync normally looks in the current directory for
a file of the same name as the one being downloaded (note: if the download is a
.gz file, the local file should be uncompressed - use gzip -d to decompress it
first). If the local file is not in the current directory or has a different
name, you can specify it with -i, e.g.:

zsync -i /var/lib/apt/lists/

Offering zsync downloads

Simple example:
Suppose you have ; which is in
/var/www/downloads/ on your server.

cd /var/www/downloads/
zsyncmake -u '' some-image-0.2.iso

This creates some-image-0.2.iso.zsync in the same directory, and specifies the
URL from which users can retrieve the full file. (Note that zsync requires both
the public URL for the full download, and a local copy of the same file. Users
will still need access to the full downloads - zsync merely allows then to save
time by only downloading parts of the file.)

A user with v0.1 of the same file can now use zsync to download only the new

zsync -i some-image-0.1.iso

Compressed example:
Support you have ; which is
in /var/www/downloads/ on your server.

cd /var/www/downloads/
zsyncmake -u '' big-0.2.tar.gz

This creates big-0.2.tar.zsync in the same directory, and specifies the URL
from which users can see the file.  

A user with v0.1 of the same file can now use zsync to download only the new

zsync -i <(zcat big-0.1.tar.gz)

Feedback, Support

Mail if you have questions about zsync. And
join the mailing list if you are using it a lot or are interested in the
ongoing development.

Copyright, Author, Acknowledgements

zsync is based on the rsync algorithm, by Andrew Tridgell. It also incorporates
a number of optimisations, based on ideas in academic papers by Utku Irmak,
Svilen Mihaylov and Torsten Suel (primarily "Improved Single-Round Protocols
for Remote File Synchronization", Sept 2004).

zsync uses a large part of zlib - this code, in the zlib subdirectory, is
copyright 1995-2003 Jean-loup Gailly and Mark Adler, see zlib/README for
details. This code contains local changes by me that are not compatible with
and not available in standard zlib; see zlib/README.zsync for an explanation.

zsync includes an implementation of getaddrinfo by Motoyuki Kasahara. See
getaddrinfo.c for the license, it's a BSD-style license; but normally zsync
compiles against the getaddrinfo() in the system libc, so this code is not
normally used.

zsync also includes checksum code taken from OpenBSD. The MD4 code is public
domain, by Colin Plumb and Todd C. Miller. The SHA1 code is also public
domain, by Steve Reid. This code is in the libhash/ subdirectory, see the
individual files for their non-copyright notices.

The rest of the code (that is, everything not in the zlib and libhash
subdirectories) is
Copyright (C) 2004,2005,2007,2009 Colin Phipps <>.
zsync is made available under the (clarified) Artistic License - see the file
COPYING for details.

Thanks also to:

* Dennis Schridde, for contributing patches to improve portability.
* Timothy Lee, for finding bugs and supplying patches.
* Richard Kiss, for supplying a patch for MacOS X compilation.

I must thank the developers above, whose code I have used. Also, I would like
to thank the Free Software Foundation and its contributors, for gcc, gdb and
emacs, the essential development tools. Also I would thank Sourceforge for
providing the hosting facilities for the downloads and mailing list, and the
compile farm for testing portability.

Also, thanks to Érsek László, James Montgomerie, James Antill,, Kent Mein, Marc Lehmann, Robert Lemmen, Mark Adler,
Ricardo Correia, Karl Kalleberg, Michael Stone, Richard Lucassen, Duncan
Mac-Vicar, Jari Aalto, Marcin Mirosław, Jan Varho and Loïc Minier for useful
feedback and bug reports for previous versions.

Something went wrong with that request. Please try again.