If you’re like most people, you probably have a lot of data stored on your home computer, in various formats. You might have photos, music, videos, and documents stored on your hard drive. You might also have important files stored on your home server, such as your email and online banking accounts. If something happens to your computer or hard drive, you’ll lose all of that data. That’s why it’s important to back up your data regularly. There are a lot of different ways to do this, depending on what type of data you’re storing. Here are some tips for choosing what to back up:

  1. Choose the right backup software for your needs. There are a lot of different backup software programs available for Linux home servers. Some programs are designed specifically for backing up files and folders; others are designed for backing up entire systems (including the operating system and all installed applications). It’s important to choose the right program for your needs.
  2. Make sure you back up frequently enough. Most backup software programs allow you to schedule backups so they happen automatically at specific times or intervals. Backing up frequently is key if you want to avoid losing any data in case of a disaster.
  3. Store backups off-site if possible. If something happens that causes you to lose all of your data (for example, if your computer crashes), it’s important to have copies of those backups somewhere else too – preferably off-site! This way, even if you can’t access your computer or hard drive, you can still access the backups and restore them if necessary." ..

If you have a home server powered by Linux, you’ll probably be upgrading your OS every so often.  Here are some important files to back up and some alternative utilities that will help you get up and running quickly.

Of course, every home server is going to be a little different, and you should adjust these recommendations accordingly—it’s just a general guide to help you understand where to start.

Image by daryl_mitchell

/home

Let’s start with the obvious.  /home contains a folder for each user on your system.  Your personal home directory is where all of your music, movies, pictures, and documents are (unless you use a separate partition for them), but it also houses configuration files for your other programs.  Hit ctrl+H in nautilus to show hidden files and you’ll see a slew of them!  Back up whatever you need.  It’s not a bad idea to back this directory up even if you have a separate /home partition, as reinstalling may overwrite a small number of these configuration files.  Repeat the process for all users.

Apt Sources

The list of software sources used by apt is located at “/etc/apt/sources.list” and the signed gpg keys are in the /etc/apt/sources.list.d/ directory.  If you’ve used Linux at all, you’ve likely installed software from other repositories than just the defaults.  After you reinstall, you may just have to change the final distro marker to the newer one (e.g. “lucid” to “maverick”) and copy those lines to your new sources.list, but for many repositories you’ll have to download a new gpg key before you can use them.  At the very least, it will at least serve as a reminder of what you had on your old setup.  Ubuntu-Tweak offers a way to install software and repositories, as well as change loads of settings, and serves as an excellent alternative to this backup.

Samba Configuration

If you set up Samba (Windows) shares, then you’ll need to copy “/etc/samba/smb.conf”.  Samba’s configurations change very little between versions, so you can just use your old copy after reinstalling it.  If you need to reconfigure it or forget to back it up, gadmin-samba (for Gnome) and KSambaPlugin (for KDE) both provide a GUI editor for smb.conf that makes it easier to edit and redo.

SSH

If use SSH to remotely access your computer, you may want to save time by backing up its configuration files, located at “/etc/ssh/ssh_config” and “/etc/ssh/sshd_config”.

fstab

The file in question is “/etc/fstab” and its job is to be Linux’s file system table.  Make no mistake, you will NOT be able to use your old installation’s fstab file on your new installation.  This is because UUIDs change anytime you reformat a partition.  However, you can copy the rest of the line in your old fstab file so that you don’t have to spend time looking up all of the options.  This is really useful if you have a lot of partitions, auto-mounted shares, a separate /home partition, etc.  You can also use pySDM (Gnome) or mountmanager (KDE), as both provide a GUI process to edit your fstab file, but be sure to do a manual backup yourself first.  From most accounts around the ‘net, it seems safest to learn about the options in fstab and edit it manually, so keep that in mind.

Backup Programs

If you have your server set up to do automatic backups with tools like rsync or Simple Backup, then you’ll want to grab their configuration files.  Rsync’s config is location at “/etc/rsyncd.conf” and Simple Backup’s is at “/etc/sbackup.conf”.

Website Files

Many people have Apache, MySQL, and/or PHP installed on their home servers to run personal websites.  While their configuration files can be a little too complicated to back up, you shouldn’t forget to do it for your website itself, located in “/var/www”.

You’re probably better off reconfiguring Apache, MySQL, and PHP when you reinstall them, as their versions can change and you may want to use newer passwords.  When you go to do that, you can easily install all three in one-shot in Ubuntu with the following command:

And yes, that caret (^) needs to be there.  Don’t forget to install phpMyAdmin to easily configure your MySQL databases!

You’ll need to hit the spacebar when you select your Apache installation.  You’ve done it properly if see an asterisk (*) come up next to it.  And, as always, make sure you change all of the default passwords for everything.  Happy re-installing!