Back up your data with BorgBackup and Vorta

Restore

To restore the archive, use the command from line 6 of Listing 1. You can do a full restore, but you can also mount an archive using FUSE, find the data, and reconstruct the data chunk by chunk. To delete an archive, you just need to replace extract with delete in the borg command. Always make sure there is enough space on the filesystem containing the repository. Once the space is completely used up, it will be difficult to free up space by deleting archives. The backup process can be automated using a script, as described in the Borg documentation.

Vorta

If the commands and scripts become too complicated, you might want to install Vorta (Figure 5), a graphical user interface. Vorta is developed by the BorgBase hosting service (see the box entitled "BorgBase"). You will also find the Vorta software in the package sources of the mainstream distributions.

Figure 5: Vorta facilitates the task of controlling Borg and implements the most important commands in a graphical interface. Vorta is a Qt-based application that is similar to some of the well known backup apps, such as Back In Time or Déjà Dup.

BorgBase

If you want to store your backups offsite, but don't want to run a server yourself, the BorgBase [3] hosting service is a good choice, offering storage space starting at two euros a month. This investment gives you 100GB storage for up to 10 repositories. BorgBase offers server locations in Europe and the USA. Recently the developers added Restic as an additional backup tool to BorgBase.

After registering with the service and confirming your email address, log in to the website. A free trial account offers up to 10GB of data in a maximum of two repositories with no time limit. First, enter an SSH public key via SSH Keys and Add Key. If you don't have one, create a new key pair with the command:

 ssh-keygen -t ed25519 -b 4096

You will find the key pair in a hidden directory named ~/.ssh. Copy the fingerprint of the key with the .pub extension to the BorgBase screen and confirm.

Add your first repository and accept or change the default EU as the location. The other settings are largely self-explanatory. In Access, you need to select the key for full access. Monitoring lets you define if and when you want to be notified if a backup process fails. In Advanced, it's a good idea to check Enable Storage Limit, otherwise the account will automatically switch to a paid plan when the 10GB threshold is exceeded.

Before initiating an initial backup in Vorta, press the button to the left of the repository you just created. This option copies the path to the repository to the clipboard; you need to enter the path in Vorta. Click on the plus sign to the right of the repository address line and select New Repository. When you get there, transfer the path you just copied and assign a password. Clicking Add will then connect the remote repository to the local Vorta client. You can now create your first backup with BorgBase. If the connection fails, take a look at the troubleshooting tips [4] for your use case. Issues are almost always due to the SSH key and the way it was integrated.

Append-only mode gives you an extra level of security. Each repository can be switched to this mode. Append-only means that Borg never overwrites or deletes data transferred in it, nor does it delete the repository as a whole. This mode can currently only be enabled at the command line. The following command:

borg config /path_to_repository/ repository_name append_only 1

enables the mode, and append_only 0 switches it off.

The first step is to create a repository; this repository can exist locally or on a remote server. Alternatively, you can add existing repositories. For authentication on remote computers, the software creates a new SSH key pair or uses an existing key pair. Compared to Back In Time, Borg's backups are about 40 percent smaller.

Then you create new repositories for the various backup tasks. For example, you can back up the entire home directory at night, while a second profile might let you create a copy of a critical directory every hour while you are working. You have the option to exclude specific paths from the backup set (Figure 6).

Figure 6: To exclude folders and files from the backup, enter the paths in the lower left corner of the mask.

Vorta offers two approaches to restoring, and both of them start with the Archives tab. After selecting the desired archive, you will see the Extract and Mount options in the right margin. After selecting Extract, you will see the backup with the full path in a new window. Highlight the directory to be restored and then press the Extract. In the next window, select the point where you want to insert the backup.

The second route is via the Mount option. In the next window, select a mount point, which is the directory that Vorta will use to give you access to the backup. Make sure that the mount point is an empty folder. After mounting, you will see a confirmation message. You can now access the archive you selected via the mount folder. Using your favorite file manager, you can restore the desired files by copying them directly from the archive and pasting them at the target location. When the process is complete, click Unmount.

The Diff switch discovers how two archives differ (Figure 7), and Check determines the integrity of an archive. Clicking Prune removes older archives. How many archives to remove and which ones you want to keep is set in the Prune Options settings.

Figure 7: Vorta can quickly restore Borg archives. The Extract and Mount options are both available for restore operations. Mount is more flexible, because you can use it to mount the archive in a folder on the target filesystem via FUSE.

Conclusions

BorgBackup is a very useful open source project supported by the contributions of more than 250 developers on GitHub [5]. The BorgBackup project has passed several peer reviews and has excellent documentation.

The main goal of Borg is to provide an efficient and secure way to backup data. Thanks to its deduplication technique, Borg is suitable for daily or hourly backups. Authenticated encryption enables secure backup to targets even if they are not fully trusted.

Vorta is a GUI by the Borg developers that integrates the most important functions into a graphical user interface. More advanced work is possible at the command line. If you want to control Borg at the prompt only, it is a good idea to check out the borgmatic [6] script, which is based on Borg. BorgBase is a hosting service that leaves the work to the professionals. Fees paid to BorgBase support Borg development.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
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.

Learn More

News