How to use Zsync to transfer a file part in Linux
Downloading large files like ISO images can be an uncomfortable task. Depending on the Internet connection, sometimes these files can take a lot of time to download and consume tons of hard drive space. Then, if an updated version is needed, the user needs to redo the entire process.
There is a solution to this problem. Zsync is a file synchronization tool for Linux, allowing users to update only the parts of the file that have been changed without downloading everything from scratch.
Zsync is based on rsync, another popular Linux tool to synchronize files or directories, and it's very easy to use. Most Linux distributions already have zsync available in the package repository, so it's easy to install and get started.
Use Zsync to download a part of the file in Linux
- Install Zsync
- Ubuntu / Debian
- Fedora
- Arch Linux
- OpenSUSE
- Solus
- Download a file
- Update a file
Install Zsync
Before starting, users will need to install zsync. It is a small command line utility, so there are not too many dependencies.
Ubuntu / Debian
Both Debian and Ubuntu have the zsync package available and both have new versions of zsync. Please install zsync with Apt.
sudo apt install zsync
Fedora
Fedora does not have zsync available. Fedora's limited repository sometimes interferes with users, but you can still install and use zsync from the source page.
First, make sure you have the necessary development tools from Fedora.
sudo dnf group install 'Development Tools'
Select the current source tarball from the zsync download page (link: http://zsync.moria.org.uk/downloads). Unzip it into the directory you want to build zsync. Then open a terminal and change it to that folder.
cd ~/Downloads/zsync-0.6.2
From there, configure, compile and install zsync.
./configure make -j4 sudo make install
Arch Linux
Arch includes zsync in its default repository. Please install with Pacman.
sudo pacman -S zsync
OpenSUSE
Users can find the latest zsync version for all OpenSUSE versions. Please install it with the favorite package utility.
sudo zypper in zsync
Solus
Solus also has zsync in the default repository. Please install it with the command:
sudo eopkg it zsync
Download a file
Zsync is a simple command line utility. Pass the URL of the zsync file to the file you want to download and it will have the right to operate. Start by downloading a file. MX Linux is a popular new distribution based on Debian Stable. MX Linux uses zsync for ISO images. Try using zsync to download MX Linux. If you don't really want a file that is too large, you can press Ctrl + C to cancel the process at any time.
zsync http://linuxfreedom.com/mxlinux/MX/Snapshots/MX-18_January_x64.iso.zsync
Note that zsync starts by checking the existing file to update. If no existing file is found, it will download the entire file.
Users also have the option to download the .zsync file directly to their computer and use it to download the target. Use the -i flag to specify the path to the file.
zsync -i ~/Downloads/MX-18_January_x64.iso.zsync
The results are exactly the same.
Users can use the -o flag to make the name of the output file change. Sometimes it helps shorten the file name to make it easier.
zsync http://linuxfreedom.com/mxlinux/MX/Snapshots/MX-18_January_x64.iso.zsync -o MX-18.iso
Again, the user receives the same file, only with a different name.
Update a file
Ubuntu also uses Zsync files for its ISOs. Users can only find them through Ubuntu's CD image server (link: http://cdimage.ubuntu.com/). This process is exactly the same as downloading a new file. Zsync will still start by searching for an existing file in the current directory. Only when the file is found, does it compare the differences between them and only download the updated sections. The image below shows what happens when zsync finds an existing Kubfox ISO.
Zsync is a great way to keep downloads minimal. The only downside of zsync is that it is not widely used. However, this tool is still worth testing, especially if you have to regularly download large files.
Hope you are succesful.
You should read it
- 5 fast and free web applications for transferring large files
- How to transfer files to / from Linux servers using SFTP
- The best SFTP server and tools for secure file transfer
- Netcat user guide
- How to use MobiMover to transfer data on iPhone to PC
- How to Transfer Files from Android to Mac
- How to use Dropbox Transfer to send files online
- How to copy files from PC to iPhone with Swift Photo File Transfer
May be interested
- How to use Homebrew to install software on Linux and Windowshomebrew is available to both linux users and windows users thanks to windows subsystem for linux, but there is an important difference in the name. on linux systems, this application is called linuxbrew.
- 4 Linux automation applications to streamline tasksthe following 4 automation applications allow users to focus on more important things, instead of tedious tasks. these tools help users save time and effort to make other things more meaningful.
- How to schedule Linux commands with 'at'utility at very easy to use. users only need to give time and date as command line parameters, then enter one or more commands to execute.
- How to change the keyboard layout in Linuxall linux desktop environments make it easy for users to customize the keyboard layout according to language, region and personal preferences.
- How to manage photos on Linuximage management in linux is no longer as difficult as it used to be. however, with the explosion of smart phones today, the number of photos taken is more than ever. this means that a strategy is needed to manage images effectively.
- How to safely uninstall Ubuntu from dual boot Windows PCyou need to uninstall ubuntu from your pc. but how to do this safely without losing data from ubuntu or windows?