Zsync, a tool to download only the new parts of a file

zsync about

In the next article we are going to take a look at Zsync. This is a program of file transfer. It will allow us to download a file from a remote server when we already have a copy of the same file on our computer, but Zsync only will download the new parts of the file comparing it with the one we have saved in our local unit. For this it uses the same algorithm as Rsync.

While rsync is designed to synchronize data between computers within the same organization, Zsync is designed for file distribution. Zsync does not require any special server software, it only needs a web server to host the files, and it does not impose any additional load on the server. This makes it ideal for large-scale file distribution.

Even though Internet plans get cheaper and cheaper, it is no excuse to waste our data by repeatedly downloading the same things over and over again. An example of this is downloading the development version of Ubuntu or any Gnu / Linux image.

As everyone knows, Ubuntu developers release daily, alpha, beta versions every few months, which are tested until reaching the ISO images stable. Before, users had to download these images every time they were available to test and review each edition. Now, thanks to the Zsync file transfer program, it will no longer be necessary. With this program it is possible download only the new parts of the ISO image. This will save us a lot of time and bandwidth. Additionally, server-side resources will be saved.

In case we use the direct .ISO file or the torrent to download an Ubuntu version, we will lose around 1,4 GB of bandwidth each time we download a new image. Zsync only will download the new parts of the ISO file as long as we have a copy of an older version of said file.

Install Zsync on Ubuntu

Zsync is available in default repositories of most Gnu / Linux distributions, although for this example we will only see how to install it in Debian, Ubuntu or Linux Mint. As I said, we will find this program in the repositories, so we will only have to open a terminal (Ctrl + Alt + T) and write:

sudo apt-get install zsync

If we need to know more about this program, we can consult its characteristics and others in the project website.

Use

We must clarify that zsync is only useful with .zsync downloads. Currently, the Debian and Ubuntu ISO images (all flavors) are available as .zsync downloads. For example, visit Ubuntu daily build.

ubuntu zsync web download

As you can see in the screenshot above, the Ubuntu 18.04 LTS daily build is available as a direct ISO and .zsync file. If you download the .ISO file, you must download the full ISO every time the ISO receives new updates. But, if we download the .zsync file, the Zsync program will only download the new changes in future updates. You will only need to download the entire ISO image in the first download.

The .zsync file contains metadata required to function with the Zsync program. This file contains the precalculated checksums for the rsync algorithm.

Download a .zsync file

To download a .zsync file using the Zsync client program, all you have to do is follow the following syntax:

zsync URL-del-archivo.zsync

Download Ubuntu 18.04 with Zsync

zsync http://cdimage.ubuntu.com/ubuntu/daily-live/current/bionic-desktop-amd64.iso.zsync

If we already have the above image file on your system available in the current working directory, Zsync will calculate the difference between the old and new file on the remote server and download only the changes. You will see the calculation process as a series of points or stars in the Terminal. Once the download is finished, you will get two images. The new version and the old image with extension .iso.zs-old.

If an older version of the file we are trying to download cannot be found, in the same working directory, Zsync will download the entire file.

We can cancel the download process at any time by pressing the CTRL + C keys.

Uninstall Zsync

Removing this program from our system will only require that we open a terminal (Ctrl + Alt + T). In it we will have to write the following order:

sudo apt remove zsync

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Jimmy olano said

    INTERESTING, we can even place it on our apache web servers to publish them online, as long as we place it in the public directories of our web page, we add:

    application / x-zsync zsync

    in our mime.types
    Thanks for the article!