Simple Linux Backup logo

Simple Linux Backup Software

SJRNet banner
Read the Article on Backing Up a Linux Desktop System at SJRNet!
SJRNet logo
SourceForge Logo
Software Requirements, License and Limitations
Downloading and Installing the Software
Running the Simple Backup Configuration Program
Details: How the Backup Script Works
Latest News
Simple Linux Backup 0.3.3 Released
Linux Format Magazine features Simple Linux Backup!
Testers, Translators needed for New Release 0.3!
Linux Format Issue 92 cover Read the Linux Format Magazine article featuring Simple Linux Backup!

The Simple Linux Backup software simplifies the task of backing up a Linux desktop system. The software was originally written to accompany my article on backing up a Linux desktop system. It includes two applications:

  • The Simple Backup Configuration Program (SBCP). This wizard asks you a few simple questions about what to back up, where to back it up, etc. It records these answers in some configuration files and sets up automatic backups for you.

  • The backup script, bkup. This shell script actually performs the backups based on the options you set in SBCP. It has no user interface – it is meant to be run automatically by the Linux scheduler, cron, or manually from a command line.

    You might be wondering, “What’s a script?” It’s just a small program – it just happens to be constructed from (in this case) Bash shell commands.

Software Requirements, License and Limitations

Simple Linux Backup relies on several other pieces of software, most of which should already be installed on your Linux system

  • Bash -- the standard Linux shell program, needed to run the backup script;

  • Tar -- the “tape archiver,” which collects files from disparate locations into a single file;

  • Gzip -- the GNU compression program, which crunches the backup file to a smaller size;

  • GTK+ -- the GIMP Toolkit, a set of libraries for creating graphical user interfaces;

  • Cron (optional) -- the Linux scheduler, which automatically runs programs at set times. You need this if you intend to run the backups automatically; and

  • Java -- the Java 1.5 (or above) runtime environment, also called Java 2 Platform Standard Edition 5.0. Many current Linux distributions install Java 1.4, so you may need to install the latest Java from Sun’s download page. The software has not been tested with other Java implementations, such as GCJ and Blackdown. At least one user has had problems running under GCJ.

Please pay attention to the following important notes about the software:

  1. This software is provided with absolutely no guarantees: it may or may not work on your system, so use it at your own risk. It is beta software and has not been tested extensively on other systems, nor with very large backups

  2. There is absolutely no warranty for the programs. Do not rely on these programs for mission-critical system backups.

  3. The programs are licensed under the GNU General Public License (GPL); for details, see the GNU license site.

  4. The software is now enabled for internationalization, but the set of translations currently available is limited. If you're interested in help with translation, contact us in the Simple Linux Backup SourceForge forums.

  5. There are versions for i386 and Mac PPC architectures currently; the Mac PPC version is brand-new and needs additional testing. Versions for other architectures are not hard to create, but we need testers to help us! Contact us in the Simple Linux Backup SourceForge forums.

Downloading and Installing the Software

You can download all the necessary software (in a gzipped tar archive) from SourceForge by clicking on the link below:

Download Software from SourceForge

Download the file that is appropriate for your computer's architecture. Currently the software is available for the following architectures:

  • i386 - Choose this if you are running a PC with a 32-bit Linux distribution installed. The file to download is named simplelinuxbkup-<release-number>-i386.tar.gz.
  • x86_64 - Choose this if you are running a PC with a 64-bit Linux distribution installed. This version has been tested on AMD 64-bit dual-core processors; it has not been tested on any Intel 64-bit processors, but may work on those as well. The file to download is named simplelinuxbkup-<release-number>-x86_64.tar.gz.
  • PPC - Choose this if you are running a PowerPC-based Macintosh version of Linux. The file to download is named simplelinuxbkup-<release-number>-ppc.tar.gz.

The software can be installed in any directory by simply unpacking the archive file in that directory. For example, to install the software in a SimpleBackup directory below your home directory using the command line, enter the following commands from your home directory:

steve@pogo:~> tar xzf simplelinuxbkup-0.3.2-i386.tar.gz
steve@pogo:~> cd SimpleBackup
steve@pogo:~/SimpleBackup> ls
LICENSE.TXT        icon.png                            runcrontab.sh       swt
RELEASE-NOTES.TXT  org.eclipse.core.runtime_3.1.2.jar  simplebackup.jar
bkup               org.eclipse.jface_3.1.1.jar         simplebackupconfig
steve@pogo:~/SimpleBackup>

To install the software using Konqueror, move the downloaded file to the directory where you want to install the software, right-click on the file, select Extract, then select Extract Here (see Figure 1 below). The process is similar to extract the file in Nautilus.

Extracting the tar.gz file in Konqueror

Figure 1. Installing the simple backup software in simplelinuxbkup-0.3.0-i386.tar.gz using Konqueror. Click the small image above for a larger version.
Simple Backup Configuraiton Program's first page, defining files to backup
Figure 2. Simple Backup Configuration Program’s Files to Backup page. Click the small image above for a larger version.

Running the Simple Backup Configuration Program

To start the Simple Backup Configuration Program (SBCP), open the simplebackupconfig file in Konqueror or Nautilus. To run it from a command line, enter the command ./simplebackupconfig in the directory where you installed the program. If you want the backup to run as the root user, you should run SBCP as root also. SBCP is a wizard, taking you step-by-step through the backup configuration. The first wizard page is shown in Figure 2.

Defining What to Backup

As shown in Figure 2, SBCP’s Files to Backup page appears first when you start the program. This page has two lists that let you select:

Selecting Hidden Files and Directories
When you use the Add File and Add Directory buttons, SBCP opens a file/directory selection dialog. By default, this dialog does not show hidden files and directories (those that have a leading period). To show those items, right-click anywhere in the file/directory list and select "Show Hidden Files."
  • Files and Directories to Back Up: This list is on the left-hand side of the window. Use its Add File button and Add Directory button buttons to add files and directories to be backed up. Adding a directory means that all files in that directory and its subdirectories will be included in the backup.

  • Files and Directories to Exclude from Backup: This list is on the right-hand side of the window. Use its buttons to add files and directories to be excluded from the backup. This is useful if you want to back up most items in a directory, but not all.

For example, suppose I want to back up the files in directory /home/steve/Documents, but not the files in /home/steve/Documents/Junk. I would use the Add Directory button on the left to add /home/steve/Documents to the Files and Directories to Back Up list. Then I would use the other Add Directory button on the right to add /home/steve/Documents/Junk to the Files and Directories to Exclude from Backup list.

SBCP writes these lists to two configuration files, BackupFiles.txt and ExcludeFiles.txt. If you want, you can manually edit these files as well.

Simple Backup Configuration Program's Where to Back Up page.
Figure 3. Simple Backup Configuration Program’s Where to Back Up page. Click the small image above for a larger version.

Where to Back Up

On the Where to Back Up page (see Figure 3), you first define whether the backup program should try to mount the backup medium. Use the “Try to mount backup device automatically” checkbox to do this. If you select this checkbox, the “Backup device mount location” text box becomes active; here, you define where the backup medium should be mounted. Or you can select the mount location from a dialog box; use the Select... button to the right of the text box to do so. For more information on determining the backup device’s mount location, see the discussion here.

On this page, you also need to define where to put the backup files on the backup medium. You can do this with the “Final backup directory” text box and its Select... button.

Simple Backup Configuration Program's Advanced Options page
Figure 4. Simple Backup Configuration Program’s Advanced Options page. Click the small image above for a larger version.

Advanced Backup Options

The Advanced Options page (see Figure 4) has several options that many users can leave unchanged from the defaults.

The first option defines where the log and backup history files will be placed by the backup script. If the backup fails for any reason, the log file should have the error details. The backup history file stores the details of the backed-up files, allowing for incremental backups. The default directory, ~/.simplebackup, should suffice in most cases.

If you select the checkbox “Allow only specified user to perform backup,” the backup script will fail if the script is run by a user other than the one you select in the “User name” field. This option is more thoroughly discussed here. The “silent mode” option allows you to turn off any output to standard out and standard error by the script. That’s useful if you’re running the backups automatically, because by default the Linux scheduler (known as cron) will email you that output; this option allows you to stop the email.

The “Directory for temporary files” option controls where the backup script will write the temporary backup file. Usually the default, /tmp, will suffice. Change it if, for instance, you need to put the temporary file on a disk partition with more space or on one that’s faster.

The final options on this page are the two Schedule buttons. When you click the Schedule with External Tool... button, SBCP will try to start a graphical scheduling tool, allowing you to schedule your backups to run automatically. Currently, SBCP searches for KCron (part of KDE in the kdeadmin3 package), gnome-schedule, and vcron. Note that these tools are not part of the Simple Linux Backup software.

When you click the Schedule with SBCP... button, SBCP will ask you what time of day you want the backup to run. SBCP will then schedule your backup to run at that time every day. It does so by adding an entry to the appropriate crontab (cron's data file) to run your backup at the selected time. Make sure your computer will be running at that time of day.

Details: How the Backup Script Works

The backup script, bkup, uses the standard Linux archive software known as tar. The script’s tar command collects all files that need to be backed up into a single backup file, called a tar archive. Because it contains all the backed-up files, the tar archive can grow quite large; as a result, the script compresses the file using gzip compression to save space. The archive files are named Backup.<day>.tar.gz, where <day> indicates what day the backup was run: Sun, Mon, Tue, etc.

A set of configuration files guides the backup script, containing information such as what files and directories to back up, where the resulting tar archive should be created, and whether the backup must be run by the root user. You can create these configuration files manually or using the provided Simple Backup Configuration Program. By default, the files are put in the ~/.simplebackup directory, but you can put them anywhere -- just specify the full directory path as the first parameter to the bkup script. The configuration files are as follows:

  • bkup_config: This file contains all options other than the lists of files and directories to back up and exclude.  It does, however, contain the names of the files that have those lists.
  • BackupFiles.txt: This file has a list of fully-qualified files and directories to be backed up.
  • ExcludeFiles.txt: This file has a list of fully-qualified files and directories to exclude from the backup.

The script is meant to be run once a day, every day. On Mondays, the script runs a full backup, backing up every file you’ve specified. The script also runs a full backup if more than a week has passed since the last full backup. On days other than Monday, the script runs an incremental backup, backing up just the files that have changed since the previous backup. It keeps track of changed files by using the tar command’s --newer option along with a timestamp file that indicates when the previous backup occured. This allows the bkup script to determine which files have changed since the previous backup.

The bkup script also produces an index file, named Backup.<day>.index. This file contains information about every file and directory that was backed up. It is meant to be used by a future Simple Linux Restore program, which is now in development.

To see detailed output of every command run by the backup script, the script produces a log file every time it runs. The log files are placed in a directory specified in the configuration files; this is one of the options you can set using the Simple Backup Configuration Program. The log files, which are compressed with gzip, are named bkup.<day>.log.gz. The easiest way to read the log file is with the less command, e.g. less bkup.Wed.log.gz.

Copyright © Steven J. Rosen. All rights reserved.