Tonic for your Backup Woes: CD Backups In Linux (Part Two) - Page 2

 By Carla Schroder | Posted Jan 16, 2003
Page 2 of 3   |  Back to Page 1
Print Article

Good Ole tar

GNU tar (Tape Archiver) is the reliable old Unix archiving workhorse. Using tar with a compression utility such as gzip or the new tool bzip2, zillions more bits can be packed onto a disk. tar preserves permissions, hard and soft links, and directory structures. Here is a simple recipe for using tar to create a compressed archive to burn to disk:

# tar -cvzWf /monday_backup.tar.gz /home/carla/
# mkisofs -o monday_backup.iso -JrVv /monday_backup.tar.gz
# cdrecord -v -eject -multi speed=8 dev=0,1,0 monday_backup.iso

Scripting is little more than stringing all the commands for a job together in one nice neat file. Plus, with scripting you can take advantage of additional elements to make a job easier, such as if/else statements, echos to screen, prompts, and error-handling.

tar is a funny little thing. It is not always necessary to use the single hyphen, as:

# tar cvzWf /monday_backup.tar.gz /home/carla/

is the same as the previous command (notice the lack of a single hyphen preceding "cvzfW"). But for tar commands with double hyphens, you must use them. It's best to play it safe and hyphenate everything correctly:

# tar --exclude=/home/carla/tmp -cvzWf /monday_backup.tar.gz /home/carla/

This example will archive, compress, and verify everything in carla's home directory, except /tmp. tar has many options for file selection which help allow for a finely-tuned backup.

Page 3: Good Ole Split

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter

By submitting your information, you agree that enterprisenetworkingplanet.com may send you ENTERPRISENetworkingPLANET offers via email, phone and text message, as well as email offers about other products and services that ENTERPRISENetworkingPLANET believes may be of interest to you. ENTERPRISENetworkingPLANET will process your information in accordance with the Quinstreet Privacy Policy.