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
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4