The sys admin's daily grind: Backup2l
I'll Be Back
At his cozy home, sys admin Charly has always used rsnapshot to back up his data. Although things will be staying this way for server backups, he has found something more manageable for backing up the Kühnast family's desktop PCs.
Backups are inevitable, and that includes desktop PCs, even the ones at home. However, in my four walls, I do not need a professional enterprise backup warehouse, and I feel no genuine desire to pay the license fee for it. I back up everything on a small Synology NAS and the NAS, in turn, is backed up on two large USB drives.
On the NAS, I have shared a directory by the name of linbackup
; below that is a subdirectory for every machine to be backed up – a total of 14 right now. My children are obviously growing up and probably starting to hoard hardware. I really wonder who they take after. There is also a gamelauncher
directory; incidentally, this is where I back up the Windows partition.
Lately, the backup itself has been handled by backup2l [1], which I've tried out in the past few days as a lightweight alternative to rsnapshot [2]. Backup2l can be controlled by cron and creates a configurable number of incremental backups. Three parameters are responsible for this in the backup2l.conf
configuration file.
MAX_LEVEL=<3>
determines the number of levels, whereas MAX_PER_LEVEL=<8>
defines the number of incremental backups per level. In my case, backup2l creates hourly incremental backups; this is the lowest level, level 3. Once it has collected eight of them (MAX_PER_LEVEL
), backup21 creates a new level 2 backup, which saves all changes since the last level 2 backup. The level 3 backups are then deleted, and the process begins again (Figure 1).
Once backup21 has collected eight level 2 backups, it creates a new level 1 backup – this is a full backup. MAX_FULL
, the third parameter, lets you specify how many full backups can exist at the same time.
Save Yourself, If You Can
I use SRCLIST
to define exactly what backup2l backs up,
SRCLIST=(/etc /root /home /var/ /usr/local)
and I can define exceptions. Backup2l distinguishes between files (-name
) and directories (-path
). Several exceptions can be linked by using -o
:
SKIPCOND=(-path "*.nobackup*" -o-name "*.o")
I use BACKUP_DIR
to tell backup2l where to save the data:
BACKUP_DIR="/mnt/linbackup/funghi"
If the destination directory, as in my case, is a network drive, the user must of course ensure that it is mounted in good time. In this example, funghi
is the name of my Ubuntu test machine. All of my desktop Linux boxes are named after pizzas, and my servers are named after Scottish islands – in both worlds, there is no big risk that I will run out of names any time soon.
The backup2l.conf
file contains two sections, PRE_BACKUP
and POST_BACKUP
, where you can store shell commands that backup2l runs before and after performing the backup. You can use this approach to make sure that certain services are stopped during the backup.
Finally, I need to tell the tool that my part of the job is done – by flipping the UNCONFIGURED=0
switch to UNCONFIGURED=1
. It's good to know that Funghi, Tonno (tuna), and the others are out of danger.
Infos
- Backup2l: http://backup2l.sourceforge.net
- Rsnapshot: http://www.rsnapshot.org
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.