linux poison RSS
linux poison Email

Large-Scale File Distribution Application - Zsync

Zsync is a file transfer program. It allows you to download a file from a remote 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. However, where rsync is designed for synchronizing data from one computer to another within an organization, zsync is designed for file distribution, with one file on a server to be distributed to thousands of down-loaders. zsync requires no special server software just a web server to host the files and imposes no extra load on the server, making it ideal for large scale file distribution.

Advantages of zsync
zsync fills a gap in the technology available for large-scale file distribution. Three key points explain why zsync provides a genuinely new technique for file distribution:

 * Client-side rsync: zsync uses the rsync algorithm, but runs it on the client side, thus avoiding the high server load associated with rsync.
 * Rsync over HTTP: zsync provides transfers that are nearly as efficient as rsync -z or cvsup, without the need to run a special server application. All that is needed is an HTTP/1.1-compliant web server. So it works through firewalls and on shared hosting accounts, and gives less security worries.
 * Handling for compressed files: rsync is ineffective on compressed files, unless they are compressed with a patched version of gzip. zsync has special handling for gzipped files, which enables update transfers of files which are distributed in compressed form.

Installing Zsync:
Open the terminal and type following command to install Zsync
$ sudo apt-get install zsync
Using Zsync:
Open the terminal and got to directory where you want to download the file and type the following command:
zsync http://cdimage.ubuntu.com/daily-live/current/oneiric-desktop-i386.iso.zsync
Either a filename or a URL can be given on the command line - this is the path of the control file for the download, which normally has the name of the actual file to download with .zsync appended. (To create this .zsync file you have to have a copy of the target file, so this file should be generated by the person providing the download).


zsync downloads to your current directory. It looks for any file in the directory of the same name as the file to download. If it finds one, it assumes that this is an earlier or incomplete version of the new file to download, and scans this file for any blocks that it can use to build the target file. (It also looks for a file of the same name with .part appended, so it will automatically find previously interrupted zsync downloads and reuse the data already downloaded. If you know that the local file to use as input has a different name, you must use -i)

zsync retrieves the rest of the target file over HTTP. Once the download is finished, the old version (if the new file wants the same name) is moved aside (a .zs-old extension is appended).




2 comments:

Anonymous said...

er... that sounds like snake oil. If I change a random byte in a file, as an HTTP client, you won't be able to tell what byte I changed until you GET all of it. That's very much unlike rsync; running server-side, you have a lot more information...

Anonymous said...

uh.. dude... the zsync file has enough information about what is in the file that it can tell that your local file is out of sync and what parts needs to be updated. The zsync file is generated on the server side. It's not snake oil. RTFM.

Post a Comment

Related Posts with Thumbnails