Simple Linux Backup Software
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:
Simple Linux Backup relies on several other pieces of software, most of which should already be installed on your Linux system
Please pay attention to the following important notes about the software:
all the necessary
software (in a gzipped tar archive) from SourceForge by
clicking on the link below:
Download the file that is appropriate for your computer's architecture. Currently the software is available for the following architectures:
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
below your home
directory using the command line, enter the following commands from
your home directory:
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.
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.
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:
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.
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.
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.
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:
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.
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
Copyright © Steven J. Rosen. All rights reserved.