Again and again, we are reminded by computer gurus to be sure to backup anything on our computers that we don’t want to lose. Still, you’d be amazed at how many users, both personal and professional, don’t bother to do so. I once had a nightmare scenario play out in a radio facility where the main server died and a good chunk of the recorded audio – music, commercials and all — just went poof in a matter of seconds.
I had only been on the job a short time and when I asked where the backups were all I got was blank stares. It seems the former Operations Manager had simply not bothered with backups at all. There were none. It took months to recover from that crash, when a good backup plan would have made it possible to restore everything in just a few hours. Ever since then, I have been obsessive about backups.
Even if you’re just using a simple laptop and not dealing with a big enterprise system, you too should be backing up regularly. So much of our personal life ends up on our computers: We store photos, home videos, music files (we paid good money for) and all kinds of sensitive documents. We also have bookmarks for web browsers and address books full of contacts that get stored on our systems and it all could be gone at any moment. Hard drives fail, file systems get corrupted and there’s always the danger of your system getting trashed by hackers, getting a virus or the potential for theft. Back it up!
When I decided to switch to all Linux all the time a few years ago, I had to find a backup solution that did what I wanted it to do. I had written my own batch script for Windows because I just didn’t like many of the solutions available and I was unsure of how I could get the same functionality in Linux. It had to be simple, do incremental snapshot style backups, and above all, it had to store the files in a format that I could access at any time, from any device. Fortunately, the tools I needed were already built right into my distro.
Pretty much every distribution of Linux comes with a nifty command line utility called rsync. It allows you to copy files and folders from one place to another. What’s more, it will compare the source directories to the destination and only update what’s changed since the last time you made a copy. This makes rsync a most excellent tool for creating snapshot backups and syncing data. One could easily issue a terminal command to create an exact copy of the /home folder and have a complete data backup of their system that includes all of the user’s files and settings.
Some will no doubt be quite comfortable using rsync ‘naked’ at a command line, but there’s a GUI front-end available called Grsync if you’re more comfortable with the point-and-click way of doing things. This wonderful little program will let you choose rsync options and save them in profiles and it will even let you do a dry run before you actually start moving data around. This is very useful because it makes it possible to catch potential errors that could end up deleting huge blocks of files with no way to retrieve them.
All you need is an external hard drive with enough space to store all of your stuff and you’re ready to go. You can also use Grsync to do backups over a network to a NAS (network attached storage) or another machine. This opens up all kinds of possibilities when it comes to moving data around a network and this versatility will become more apparent as your home network grows.
I would be remiss if I didn’t take a moment to point out a few things to keep in mind as you figure out a backup scheme. First off, it is never a good idea to put your backups on a drive that is physically located in the same machine that your data is on. Many folks will stick a second hard drive in their computer and then copy data to it and call it a backup. While having any backup is better than none at all, if the power supply fails or the machine is struck by lightning and all of the drives are fried then all of the data is gone. It’s much better to drop a few coins on a nice external drive and use that for backing up.
Another thing to keep in mind is that your backup drive should be formatted with a file system that is native to Linux if you’re going to backup the entire /home directory. Many drives come formatted for Windows with NTFS or FAT32. Linux will happily read and write to these file systems but the file permissions and attributes are not saved in the same way and this become critical if you’re going to restore files from multiple users or system configuration files. If you’re just backing up photos, documents and media files than it doesn’t matter all that much.
For me, one backup isn’t enough. I not only backup to an external drive, I also sync data between three machines. All of them have all the same stuff so if one dies all I have to do is move over to the next machine and keep going.
What about all those nifty backup utilities that come with Linux distros? Well, they are certainly alright if you have a small data set or you don’t mind not being able to directly access your backups. Many programs make it so that you must use the same program to restore your data. That makes me just a tad nervous because there are times when that program might not be available. What if you wanna move data from two machines with different operating systems or just need to grab one or two files or folders?
These are all questions that need to be asked when looking at how a backup program works. It just makes more sense to use simple tools and keep up with it myself. I’m a strong believer in keeping things simple and making it so I know exactly what’s going on at all times. I grab my backup drive when I’m upgrading distros or building a new machine and all I have to do is plug it in and drag the files into my new home folder to have the system up and running in no time.
Grsync did the trick for me and it might be just what you’re looking for too. Grsync is in the repositories of most distros. To install it on Ubuntu or Linux Mint just issue this command:
sudo apt install grsync
Keep your important data safe and have fun.