Back up your data with BorgBackup and Vorta
Keep It Safe
BorgBackup and the Vorta graphical front end take the stress out of creating backups.
If you want to keep your data safe, it is a good idea to think about a backup strategy and implement it in a consistent way. The more important the data, the more security you need for the backup. Experts recommend that you should back up irreplaceable data twice, with one backup location outside of your own four walls.
Linux offers a variety of backup applications – for both home and work environments. Some are limited to the desktop; others are intended for backing up data on remote servers. One solution that works well in remote backup scenarios is the powerful BorgBackup [1] or Borg for short. Borg can store backups on local drives or remote computers in a space-saving and secure way. Thanks to the intuitive Vorta graphical interface, Borg is suitable for home users as well as professionals.
BorgBackup
Borg runs at the command line, but you can also control it using the alternative Vorta graphical front end. Written in Python 3, Borg offers features such as deduplication, compression, and authenticated encryption. The data compression supports the LZ4, LZMA, Zlib, and Zstd standards. When it comes to deduplication, it is worth pausing to consider what the term actually means in Borg speak.
Deduplication is generally understood as a space-saving technique that breaks data down into blocks of the same size (which Borg refers to as "chunks") and computes a checksum for each block. If a new file has a known checksum, this means an identical version of the file already exists. At this point, the software compares the file contents to make sure they are identical. The app is not restricted to the file level, but it can also save minor changes to large files as chunks, which makes for very effective deduplication. The program even recognizes files if they have been moved or renamed.
Borg is available from the repositories of most mainstream Linux distributions; the package is called either borg or borgbackup. If you want to set up Borg for client-server operation, you need to install the software on all of the computers involved in the operation. If the Borg version packaged by your choice distribution is too old, you can also install from the source code, use a binary, or fire up pip
or git
. The Borg documentation describes the installation procedure in detail [2].
Deduplication
Comparing checksums, which is the preferred method for duplication, saves time over comparing the file contents in each block. The checksum method also has lower memory requirements because, if two identical blocks occur, it deletes the second block, replacing it with a pointer to the identical first block. This approach makes Borg a good candidate for use cases where working directories are constantly changing – you can back up every hour without generating large volumes of data.
Repositories and Archives
You can back up the directories on a laptop to an external hard disk or, alternatively, transfer the backup to a remote computer using SSH (Figure 1). Borg stores the backups it creates in repositories, and repositories are stored in folders (which Borg refers to as archives). So, you need to create and initialize at least one repository on the target computer or an external hard disk (Figure 2). The first three lines in Listing 1 create the repository.
Listing 1
Preparing and Installing a Repository
01 $ cd /media/extern 02 $ sudo mkdir borgbackups 03 $ sudo borg init -v -e repokey media/extern/borgbackups 04 $ sudo borg create --stats /media/extern/backups::1 ~/Pictures ~/Documents 05 $ sudo borg list /media/extern/borgbackups 06 $ sudo borg extract /media/extern/borgbackups::1
If you use encryption with the -e
option when creating the repository, the software prompts you for a password. (Initially, it is useful to use the -v
option for verbose output.) Borg is then ready for a first backup (Listing 1, line 4). The borg create
command (Figure 3) creates the backup in the specified path to the repository. The name of the archive where the app stores the backup is 1
in this example; the software automatically creates the matching folder.
The next command lists the folders to be backed up. The --stats
option takes care of outputting statistics for the newly created archive, such as the volume of data, the deduplication level, and the number of chunks. The command in line 5 of Listing 1 displays all of the archives in the repository (Figure 4).
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.