Thursday, March 28, 2024

Best Ubuntu Backup Applications

Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Even today, there are still folks who believe there aren’t any decent applications for backing up an Ubuntu installation. To remedy this issue, I’ve put together my personal recommendations for the best Ubuntu backup applications.

Partition or bare metal backups

dd – If you’re comfortable with the command line or are willing to learn more about it, then dd is a solid option. One word of warning though. Using dd is a lot like asking a robot to accomplish a task. It’ll work, but the results you end up with are going to be exactly what you ask for. For example, if you accidentally have your drives reversed with dd, it’s still going to copy those blocks from one hard drive to the other. Unfortunately for you, it could be in reverse…overwriting your source disk on accident.

Putting that issue aside however, dd can be used safely so long as you’re positive you have your source disk in the right part of the command. Another benefit is that dd doesn’t care what OS, partition or format you are using. It simply moves data from one disk to another. That said, you can choose to clone an entire hard drive or narrow things down a bit by merely cloning a partition.

To clone an entire hard drive:

dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync

To clone only a partition:

dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync

The difference between these two examples is that sda/sdb represents two separate hard drives where sda1/sdab1 represent different partitions on two separate hard drives.

Clonezilla – For those who would rather not duplicate each data block or use a command line to clone their partitions, then perhaps Clonezilla would be a better match. The closest comparison from the Windows world would be True Image or Norton Ghost. In many ways, Clonezilla is arguably more efficient than dd in that it’s only going to clone and restore used blocks vs tons of empty space. This alone makes Clonezilla a great drive/partition cloning solution.

It’s worth noting that Clonezilla offers users the ability to clone an entire hard drive or simply clone your drive into a disk image. The disk image differs in that it’s basically copying your hard drive/partition contents into something similar to a zipped folder. Also, when you’re cloning your drive/partition, you have the option of connecting to a local drive, USB, NFS, Samba and even a straight up shell command if you need something more advanced. Using Clonezilla is as easy or complex as you want to make it. The app does a great job of walking its users through all the steps. And if you get stuck, they have solid documentation.

Rsync based backups

Rsync – Like dd, rsync is a command line tool designed to give you tons of flexibility in how you backup your stuff. Rysnc differs in that it provides you with incremental backups of your files and directories, not entire hard drives or partitions. This is useful for daily backups.

So how does rsync differ from the cp command? Basically, cp is an all or nothing proposition. If it fails, too bad, you’re starting over. Also cp is a mess with larger files where rsync can be setup to utilized less band width and to break up large data transfers to ease congested networks. In short, cp is a club whereas rsync is a scalpel.

Using rsync as a backup makes sense when you want to preserve your data, its permissions and especially if you moving large files over a network to another destination.

Here’s a great example you might find interesting:

rsync -a  /folder/to/backup /location/of/backup

This will use the archive option to keep permissions intact while it copies the source data to the assigned destination. To automate this process, you can add this to a crontab. While it isn’t always recommended if you do a lot of distro hopping or switching desktop environments, I’ve been known to use this as a means of backing up select system directories to create a simple restore option if I mess up an installation. For example:

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder

The above rsync script will backup key system directories, preserving permissions, ownership and any related symlinks. The excluded directories are stuff you don’t want to backup as it would actually complicate a restoration. Note: using rysnc to backup system files is no replacement for a good cloned partition. So use at your own risk. I also recommend backing up your home directory in a separate archive, to ensure the best chance for a clean restoration.

Back in Time – For those of you that prefer to use a GUI to backup elements and directories within your home directory, I recommend Back in Time. It’s extremely simple to use, provides a handy rsync frontend that gives you file and directory snapshots in a visual manner. Even better, you can “time machine” back to another date to restore your files. Back in Time is a current application, maintained over on Github. Plus, it provides a GUI friendly tool to automate your backups so you can set it and forget it using a crontab.

To be clear, this is not a tool you would use for anything other than backing up your entire home directory or to backup individual directories without your home directory. To backup your system files, you’ll be using something different. Also, you can use SSH (with a key – no password) to remotely backup your data to another machine.

Time Shift – If you’re bent on backing up your system directories and files, but don’t feel comfortable using the rsync script above – then Time Shift might be a good option. I’ve personally used both the rysnc script above and Time Shift. In both instances, my restoration(s) were successful. The one difference was that Time Shift allowed me to select which period of time I wanted to restore from. I also like that Time Shift gives you the option to include your bootloader or not. This alone, sets it apart from similar applications.

The one killer downside is that it stores your backed ups in a /timeshift on your root drive. If you have a drive failure, this application isn’t going to help. So be aware of this short coming and consider using Back in Time to backup your home directory contents to a remote destination.

Deja Dup, AMANDA and other backup tools

Now you may have noticed that I didn’t include enterprise level tools like AMANDA or the non-enterprise GUI for duplicity known as Deja Dup. The reason is simple – for many folks reading this article, the AMANDA would be overkill and Deja Dup isn’t nearly as flexible as Back in Time.

What say you? Do you have some specific backup tools you’d like to share? Perhaps you prefer to tar your data before you use rsync? Hit the Comments, let’s hear about your favorites!

Subscribe to Data Insider

Learn the latest news and best practices about data science, big data analytics, artificial intelligence, data security, and more.

Similar articles

Get the Free Newsletter!

Subscribe to Data Insider for top news, trends & analysis

Latest Articles