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
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.