Keeping databases in sync
In Sync
As your data volume grows on your home computer, you can quickly and easily create a reliable backup using FreeFileSync.
Thanks to digital cameras, MP3 players, and smartphones with HD video capabilities, users can easily fill up their terabyte-sized mass storage devices. The stored data often includes irreplaceable material, such as photos from birthday parties or holiday videos. Thus, it becomes even more important to back up your data so that it's not lost if the hard drive fails. Traditional backup solutions, however, are often cumbersome to operate and can overwhelm home users with a wealth of functions they don't need. This is where FreeFileSync [1], which is aimed specifically at private users, comes in.
First Use
Most common distributions have FreeFileSync in their repositories, and you can usually install it easily using a package manager such as Synaptic or YaST. However, if the current latest version (6.13) is important to you, you will need to download it from the project website. There, the developers provide both customized tarballs for some large distributions as well as the source code for a manual build [2].
After successful installation, FreeFileSync appears in the menu structure with a starter, which you can click for easy access. The intuitively designed program window will catch your eye when you first start it. The menubar is in the header with the toolbar underneath. The two buttons Compare and Synchronize particularly stand out; the cogwheel buttons next to them can be used to access the corresponding settings. A routine for creating filter criteria is hiding behind the button with a funnel icon. The software also has a small statistics display at the bottom right. The main window with its three panes displays the directories to be synchronized and a checklist.
The first step is to determine which disk or directories you want to include in the synchronization. To this end, above the lists, you'll see an input field where you can enter the respective paths. By clicking on Browse to the right of the input fields, you can select the paths using the integrated file manager. To get an overview of the differences of the existing databases, click on Compare. You can control the behavior by clicking on the cogwheel next to it. The selections include, among other things, which method the software uses to compare the databases. Available options are file content, date stamp, timestamp, and file size. Depending on the size of the scheduled backup, synchronizing the contents of the file can take a lot of time. In the test, the software compared about 25-30MB per second. Thus, it's advisable to make the default comparison by date and size for larger volumes of data.
After you click Compare, the program lists the files contained in the directories and subfolders of the source and target that are missing on the other side. An overview window to the left also shows the percent differences, ordered by the directories concerned. You will also find a column with three elements between the file lists. The checkbox lets you exclude individual files and directories from the sync; the action set in the program is shown in the right-hand column (Figure 1).
Keep in mind that a continuous comparison of source and target disks can take a long time, especially when using flash memory cards and USB memory sticks. This increased amount of time required is caused by inferior-quality memory chips often used for removable storage devices, which only allow relatively low speeds for reading data and even lower write speeds. For reasons of data safety, it is not advisable to use such media as a primary storage when backing up important data.
Using the integrated filter options, you can define certain file formats or search paths that you want the tool to include or exclude explicitly during the synchronization. To this end, press the button with the funnel icon at top center in the program window. You can determine the criteria and apply them by clicking OK in the straightforward dialog box (Figure 2).
Mirror, Mirror …
You need to adjust the synchronization settings to receive a complete mirror copy of the source medium when first synchronizing the databases. To this end, the program provides several variants after clicking on the green cogwheel next to Synchronize. Choose the Mirror option for the first sync (Figure 3). The software mirrors all data from the selected path to the backup medium. This step also includes delete actions if the path already contains data. After pressing OK, the software synchronizes the lists displayed and shows statistics bottom right in the program window about the databases it is deleting, overwriting, or recopying.
On the left in the Overview pane, the program window displays all the folders in alphabetical order with the respective percentages of data to be modified. Click on the folder in question to see more information about which databases will be deleted, recreated, or overwritten in the listed directories. FreeFileSync now changes the display in both list windows so that only the selected folder and its subdirectories appear in it. Green symbols arranged line-by-line between the list views show you what happens to the respective file.
You can determine which actions the windows display in the lower section next to Select view. The available options are copying in one direction or the other and displaying identical files that remain unchanged. The software then correspondingly updates the list views so that you can see an overview of how the software will handle these files, with just a few clicks of the mouse; this is especially useful for extensive databases.
After subsequently clicking on Synchronize, the program again opens a small window that displays the pending actions for you to check. Press Start in this window to start the sync process (Figure 4). By default, the software adopts the synchronization requirements you adjusted in the Compare settings. To change this, click on the cogwheel to its right and adjust the values to suit your needs.
The software displays a progress indicator in a dialog box during the synchronization run so you can follow its progress (Figure 5). The list views remain empty because the databases no longer differ from each other after synchronization.
It is no longer necessary to mirror the complete database to synchronize directories that have been synchronized in the past. For one thing, depending on the synchronization interval, each sync can take quite a while to complete; for another, you are overwriting data despite it having identical content. It is therefore advisable to shift from Synchronize to Update in the configuration menu. The software now only copies new databases from left to right or those that have changed since the last sync. The statistics display shows that the database to be copied is significantly smaller than it would be for a complete mirror image.
Semi-Automatic
The Custom button in the Synchronization Settings dialog lets you create individual rules so you can synchronize your databases more flexibly than with the three preset options Two-way, Mirror, and Update. To this end, click the corresponding option on the right in the Action line. This way, you can synchronize databases simultaneously in both directions, for example, without having to start a second process (Figure 6).
The software immediately displays any errors that occur during data synchronization. Typically, it gets stuck when using different filesystems. Errors can build up especially if one of the two storage devices uses FAT32. You can safely ignore the error messages at first and sort out the remaining problem cases manually once the process has completed, because the software leaves non-synchronized files in the list window.
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
-
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.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.