Backup Software


YaST System Backup covers only vital system files. Many other tools exist to help you back up your more ordinary Linux files. They range from the simple command-line archiver TAR to commercial industrial-strength products like Arkeia and BRU. In this section, you'll learn more about archiving with tar and two GUI applications, File Roller and Ark, that will help create archives for backup purposes.

Archives and Compression Formats

Perhaps you've heard of the National Archives, the building in Washington, D.C., where the original Declaration of Independence and millions of other documents are stored. And perhaps you're wondering what that has to do with backup files.

Like the National Archives, the TAR format keeps important files safe and together. It puts a wrapper around a group of files that you designate. Their relationship can be as tight as a group of files that form an executable program or as loose as "the files I want to back up."

If your backup medium is limited in space, you can use a compression program to squeeze out redundant information to shrink a file to take up less space. Programs such as GNUZip and bzip use an algorithm to take text like the word redundant to note that it has a pair of Ds and Ns and reduces the size of that word by 11 percent. Taken over an entire document file, these algorithms can save a lot of space counting instances of letters, spaces, and other characters.

You can use TAR and the other compression programs with the shell or use a GUI client. By default, SUSE Linux uses the GNOME Archive Manager to work with archives, but the KDE Ark program works at least as well.


Backups with tar

The Tape Archive utility, tar, is one of the oldest in the Unix toolkit. It masterfully follows the Unix philosophy of "do one thing well." That thing is grouping files together in one easy-to-transport package. For doing backups, tar offers a simple command-line solution. This command archives the whole /etc directory and places the archive in the current directory:

tar cvf etc.tar /etc 

These options create a new archive with the filename etc.tar that copies all files in the /etc directory to the archive. As it does this, tar is verbose in telling you what it's doing; that is, you'll see a stream of filenames rolling down the shell as each is added to the archive.

If you add the z switch to this command that is

tar cvfz etc.tar /etc 

You will also compress the files with Gzip. Similarly, adding the j switch would use the bzip formula.

The tar utility can also be used to back up data directly to a tape drive. Most tape drives use a SCSI interface and are accessed through /dev/stx; where x refers to the number of the tape drive in the system (st0, st1, st2, and so on). For example, if you have a single SCSI tape drive in your system, you would access it through /dev/st0.

To create a backup job and send it to the tape drive, complete the following:

1.

Using YaST, make sure your tape drive was detected during boot and that the correct driver was loaded. Usually this isn't a problem, especially if you use a widely recognized SCSI board in your computer (such as those from Adaptec).

2.

Insert a tape in your tape drive and wait for it to load and queue up.

3.

Open a terminal session.

4.

At the shell prompt, enter tar options /dev/stx path_to_be_backed_up. For example, to create an archive of the /home directory (and all its subdirectories) on the first SCSI tape drive in the system, you would enter tar -cvfz /dev/st0 /home. If the size of the archive exceeds the capacity of your tape, you will need to remove the -z option and add the -M option. This will allow the tar archive to span across multiple tapes.

5.

When the job is complete, you can rewind the tape and eject it at the command prompt using the mt utility. This is done by entering mt -f /dev/st0 rewoffl. The mt utility can also be used to perform a number of other tasks with magnetic tapes, such as erasing, rewinding, and fast forwarding. Check out the man page for mt for more information.

A key component of an effective backup strategy is to make sure backups occur regularly. Using the crond daemon, you can configure tar to automatically back up your system at a set time each day (usually later at night when you aren't using the system). This relieves you of the responsibility of remembering to manually start the process. Invariably, the day you forget to run a backup is the day you will end up needing it. Review the tar man page to discover the power and flexibility of this utility, and then put it to work in your backup scheme.

Using Ark

Ark is a very easy-to-use application that can create or open plain and compressed archives in several formats: tar, gzip, bzip, zip, rar, jar, to name a few. It's the default archive tool if you're using your SUSE Linux system with a KDE shell. As with many applications designed for KDE, it will work under GNOME as well. To create a new archive using Ark, complete the following:

1.

Select Kmenu, Utilities, Archiving (assuming you're using KDE).

2.

Select File, New.

3.

In the Create New Archive screen, enter a name for the archive in the Location field.

4.

In the Filter field, select the type of archive you want to create. Most of the time, you will probably want to create a gzipped tar archive.

5.

Select Save.

6.

To add data to the archive, select either Action, Add File or Action, Add Folder.

7.

Wait while the files are added to the archive.

Alternatively, you can also create an Ark archive by right-clicking files from within Konqueror and selecting Compress, Compress as archive_name.tar.gz from the menu. The new archive will be created and saved in the location you specify.

After it is saved, you can open any existing archive and add files to it. This is helpful if you have some files in other directories. Figure 20.5 shows you how an existing archive appears in the Ark window.

Figure 20.5. The Gzipped archive for the Azureus BitTorrent client in an Ark window. Notice the directory at the top, with the path included in the filename listing.


Using GNOME File Roller

File Roller is the default archive tool for SUSE Linux even if you're using the GNOME shell. It integrates well with Nautilus, the GNOME file manager, allowing for drag-and-drop adding of files to new archives.

If you open Nautilus and then File Roller in the same desktop, you can drag files from Nautilus to File Roller. The archiver then asks if you want to create a new archive with the selected files. Click Yes to open the dialog box you see in Figure 20.6.

Figure 20.6. Save a new archive in File Roller.




SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net