Configuring a Personal Backup Solution

A home office is a wonderful thing – your commute time is zero, and you’re in easy reach of the refrigerator. But your home office may also be missing some of the niceties of a conventional office setting – like free coffee, and perhaps, a regular backup routine.

In the office, backups are usually handled by a system administrator, which may make the process sound complicated and difficult. But, free software is all about empowerment, and many of the available personal backup tools are easy to configure and use.

Your backup solution can be as big and complicated as you want to make it. Enterprise-ready backup tools offer powerful options and can back up hundreds of clients, but the latest generation of ordinary personal backup tools are all you need for your home environment.

Source and Destination

The backup concept is simple and requires little explanation. The basic idea is to take files from one place and put them somewhere else. In this respect, all backup tools are similar. When you configure a backup you are defining:

  • The source – where are the files coming from?
  • The destination – where will the backup set be saved?

Many backup tools also let you schedule a time for the backup or specify compression, encryption, and other options.

The backup destination is a fundamental question that could define your choice of a tool. Although it is possible to back up a directory to the same hard drive where it is stored now, and doing so will certainly protect you from problems caused by accidentally deleting or corrupting the working copy of a file, you won’t be protected from a hard drive failure. The whole point of a backup should be to get the data off your computer

A USB stick or an external SSD drive are two simple choices, but many users find it more convenient to back up the data across the network to a remote system. Some users prefer to configure a small file server on their own network, which could be as simple as a Raspberry Pi, but more users today are opting for cloud-based backup alternatives. This article highlights three popular options for personal backup: rsync, Déjà Dup, and Duplicati.

Rsync – Start Simply

The Linux command-line utility rsync is a simple and versatile backup tool. If you want something really simple, and you’re comfortable working at the command line, rsync is a good place to start.

Many Linux systems come with rsync already installed. If you don’t have it on your computer, set up the package with your local package manager. For APT-based Linux systems like Debian and Ubuntu, enter:

$ sudo apt-get install rsync

The rsync utility has a very simple syntax and supports a number of command-line options. The basic syntax is:

rsync [options] source destination

The -a option (for archive) tells rsync to back up recursively (include subdirectories) and to include symbolic links, devices files, modification times, group and ownership settings, and permissions. For example:

rsync -a directory_a directory_b

creates a backup of directory_a on directory_b. The preceding command as written copies the directory itself and places it under directory_b. If you just want to copy the contents of directory_a (without recreating the directory structure), add a trailing slash to the source:

rsync -a directory_a/ directory_b

Other common options are -v for verbose output and -z for compression. The --delete option deletes extraneous files from the destination directory, which means if you delete a file in the source directory, it will get deleted in the destination folder also. The option --compare-dest=DIR, which is useful for incremental backups, compares the file version on the source with the version already present at the destination and doesn’t copy files that are identical or newer in the destination directory. The --log-file option lets you specify the file name for a log with a report on the results of the command:

rsync -av --log-file=file_name directory_a/ directory_b

These simple rsync commands are all you need to back up to a second hard disk or external SSD drive, however, backing up across the network requires a little more information. To start, the remote server that you are backing up to also needs to be running rsync. By default, rsync uses SSH for network commands, so both ends of the connection will need to have SSH running. To push the backup from the local system to the remote server, enter:

rsync -av -e ssh directory_a/ username@122.121.100.13:path_to_directory/directory_b

where username is the login name for the remote user in SSH and 122.121.100.13 is the IP address of the remote server.

Many experts believe it is more secure to instead pull the data from the source system to the server. Execute the following from the server system:

rsync -av -e username@source_IP_address:path_to_directory/directory_a path to directory_b

The rsync utility does not have any built-in scheduling features, so admins tend to automate it by adding it to a cronjob or building it into a script. 

As you can see, rsync is quick and easy for a simple backup project, such as backing up a directory to an attached SSD drive. If you need a more complex solution, such as backing up multiple directories across the network, you might find it easier to use one of the many useful GUI-based backup tools that inhabit the Linux repositories.

Easy Desktop Backup with Déjà Dup

Most Linux systems have a personal backup tool that is either included by default or easily installed and well supported. Déjà Dup, which is included with many Gnome desktop systems, is a good example of any easy personal backup tool for Linux. Similar tools are available for other desktop systems.

Déjà Dup is the default backup tool on Ubuntu and many other Gnome-based distros. Sometimes it appears in the Accessories menu, and sometimes it shows up as a System Tool. This handy backup utility fits neatly into the background, and sometimes it isn’t even called out by name and is instead given a generic name like Backup, but you will recognize the little icon in the form of a safe. If Déjà Dup isn’t present on your system, install it using your package manager. (But seriously, if your system is set up for another personal desktop backup tool, you might rather just use it instead – it is likely very similar.)

Déjà Dup opens to an uncluttered main page, where you can choose any of the available options with a single mouse click (Figure 1). The left-side menu links to pages where you can configure all the usual backup parameters.

Figure 1: Déjà Dup’s uncluttered main page offers all the important options in a single mouse click.

Fig 1

To define a backup set, click on Folders to save and select the folders you wish to back up. Your home folder will appear on the list by default. Click on the plus sign (+) to add additional folders, then select Folders to ignore to exclude any subfolders from the collection defined in the previous step. Note that Déjà Dup excludes certain folders by default (including cache files, thumbnails, and the /proc, /sys, and /tmp directories).

The Storage Location panel lets you choose to back up the data to a local folder or a network server, and Déjà Dup also has built-in support for backup to Google or Nextcloud (Figure 2).

Figure 2: The Storage Location panel lets you configure a local folder or network server. You can also choose to back up to Google or Nextcloud.

Fig 2

If you are backing up to a network server, define the server location and directory location with a URL. Déjà Dup supports a number of network protocols, including AppleTalk, FTP, NFS, SMB, SSH File Transfer Protocol, and WebDAV.

Click on the Scheduling tab (Figure 3) to choose whether to perform the backup daily or weekly. You can also select whether to save the backup forever or delete it after a year or six months or other time of your choosing.

Figure 3: The Scheduling panel offers a few options for configuring backup frequency.

Fig 3

To initiate a backup manually, click the Back Up Now... button on the Overview page. Déjà Dup asks if you would like to protect the backup using a password. The password encrypts the backup set using GPG and stores a trio of files in the target directory (Figure 4).

Figure 4: Déjà Dup stores three files in the destination directory.

Fig 4

If the backup is encrypted, the files will have the .gpg file extension. If you choose not to encrypt, the files will be compressed GZIP files with the .gz extension. To restore the files, just click the Restore button on the Overview page and point Déjà Dup to the backup folder. If you provided a password to encrypt the backup, you’ll need the password to unencrypt.

Déjà Dup is designed for a single user and small-scale backup operations. Within that context, it is quite easy to back up to cloud, network, or local destinations with only a few mouse clicks. As you may have noticed, though, Déjà Dup has some limitations. For instance, the user interface doesn’t let you schedule a backup for a specific time or implement a regular schedule other than daily or weekly.

Also, note that Déjà Dup creates full backups of specific files or directories. You can’t configure a schedule that includes an incremental backup, which only saves files that have changed since the last backup date. According to the project developers, Déjà Dup was designed for the modern era of abundant and inexpensive disk storage. The goal is to minimize the user’s time in configuring and managing backup and restore operations – not to minimize disk space.

To the Clouds

If you’re looking for additional options and a wider variety of cloud alternatives, you can try the Duplicati backup solution. Duplicati is based on a C# implementation of Duplicity – the same tool that forms the basis for Déjà Dup – but Duplicati provides many advanced options that aren’t possible with Déjà Dup, and it comes with support for an impressive list of cloud providers.

In addition to supporting network protocols such as FTP, SFTP, and WebDAV, Duplicati is preconfigured to manage backups to OpenStack, Amazon S3, Azure blob, Box,com, B2, Dropbox, Google Cloud Storage, Google Drive, HubiC, RackSpace Cloudfiles, Microsoft SharePoint, Microsoft OneDrive, and other services.

Look for Duplicati in the package repository for your Linux distro. You can also download Duplicati from the project website. The Duplicati project maintains the latest packages for Debian/Ubuntu, Fedora/Red Hat, 32-bit Windows, and macOS systems. The download also provides a link to the GitHub site with the Duplicati source code. Because Duplicati is written in C# (a .NET language), one of the dependencies is the open source Mono .NET implementation.

After you successfully complete the installation, look for Duplicati in the System Tools menu. When you start Duplicati, you’ll see it looks quite a bit like other GUI-based backup tools (Figure 5). To configure a new backup, click on Add backup and select Configure a new backup. Duplicati shows you a series of panels for configuring the destination, source, schedule, and other options. Click the Next button in the lower-right corner to move among the panels.

Figure 5: Like other personal backup tools, Duplicati provides a simple and streamlined user interface.

Fig 5

On the Destination page, click on the box labeled Storage type and choose your preferred protocol or storage provider from the pick list. The configuration options below will change depending on which storage type you select. When you get to the Schedule page (Figure 6), you’ll notice that Duplicati offers a variety of options for selecting the frequency and time of day for the backup.

Figure 6: Duplicati offers more options than Déjà Dup for configuring the backup time and frequency.

Fig 6

Conclusion

If you find yourself working from a home office, now is a good time to be your own sysadmin and set up a personal backup solution. Whether you are backing up to a USB stick, a local server, or a cloud provider, you’ll find a FOSS solution tailored for your needs. Rsync, Déjà Dup, and Duplicati are just a few of the simple yet powerful free backup tools available for Linux systems.

Subscribe now to FOSSlife Weekly and get news and features delivered to your inbox.

woman with dark ponytail in front of computer

Comments