Easy Backup and Restore

November 22nd, 2005 by Alan Keates in

Are you still not doing backups on a regular basis--or at all? With this easy-to-follow procedure and ready-made scripts, you're out of excuses.
Your rating: None Average: 5 (1 vote)

Until recently the extent of my backup efforts was to take the occasional CD copy of my home directory and keep copies of important files somewhere else, usually on another disk partition or a floppy disk. All of this changed with the need to run some Windows legacy applications. The only machine really suitable for this work was my main workstation, a 1.2GHz Athlon machine, multibooted with four distributions. I decided to free up the first primary partition, which held Mandrake 9.0, and set up a Windows partition.

I freed up the first primary partition by transferring its contents to the seventh partition, overwriting an expendable Vector Linux 3.0 Distribution. To be totally safe, I booted into Debian 3.0 and mounted both partitions to individual mount points in /mnt. Then, as root, I used tar and a pipe to copy everything, including all links and permissions, from the source partition to the target partition. A few minutes later, after changing my GRUB boot menu, I was able to boot into Mandrake 9.0 Linux in the seventh partition and verify that everything worked as expected.

At this point, one normally would DOS-format the now free first partition and install Windows. I began to feel a little uneasy, however. Windows could format the whole darn drive or some other similar screwup could happen, in which case I would be in the position of having to fdisk the partitions and reinstall everything from scratch. The original disks, of course, would have all the applications except for those extra packages installed by me, but all custom configurations would be lost.

The machine now was running Mandrake 9.0, Debian 3.0 and Slackware 8.1. Of these, only losing my Slackware install would cause me grief, as it has been running like a top, boots to KDE 3.0 in less than 30 seconds--including my sign on--and is absolutely rock-solid stable. It also has the CUPS printing system set up perfectly for all of my printers on the LAN. So I must retain this setup at all costs. The solution, of course, is to back up fully everything from the Slackware install.

At this point, the desire to have a simple, easy and foolproof backup and recovery method took hold.

What Do We Really Need for a Backup and Recovery System?

If you are a home or SOHO Linux user, I suggest that your backup and recovery system should:

  • Require no equipment or software other than what you already have

  • Be cost effective in backup media

  • Be easy to use regularly, or it will not be used at all

  • Be easy to verify, or it may be useless when the time comes

  • Require only the media and a working machine, in the hardware sense

  • Require only minimal knowledge of the recovery process when the crunch comes

A quick review of past Linux Gazette articles and a search of the Web turn up hundreds of backup solutions. Many are aimed specifically at the backup function; others are aimed at the repair and system recovery part of the overall effort to get back to some predefined state. Virtually none are customized for your system or your specific requirements, so why not roll your own solution? That is what we do here.

What Can We Use?

Most home or SOHO users do not have a tape drive system and are unlikely to purchase one for the sole purpose of backup, given that the cost of the tape system and software probably exceeds that of the computer itself. This essentially narrows our options to backup to removable disk, backup to the same or another hard drive, backup to a CD or backup over a network to some other hard drive. This last option essentially is a more complicated backup to local hard drive option, except there is zero chance of it being lost when your system goes down. So let us look at these options:

  • Floppy: Good for incremental backups on a daily basis and perhaps the best solution for saving work as it progresses, but useless for system-wide restoration. The LS120 Disk and the Zip disk are not large enough or common enough to be considered for the sort of simple but complete backup considered here.

  • Hard Drive: One can back up to a separate partition on the same drive, which is of little use if that drive fails, or one can back up to another hard drive in the same computer. This is good, except there is a fair chance that a power supply failure or nearby lightning strike could fry both drives--or somebody could steal the computer--leaving nothing to restore.

  • Network Filesystem Transfer: This is a good solution to back up and restore files for someone interested enough to correctly install it. however, it does nothing for the process of getting the system up again to the point where one can restore the files. In short, it's too complicated for most people to institute.

  • CD-ROM: This is where things begin to look interesting. These days most Linux users have a CD burner, and the availability of cheap CD-RW disks means the cost of maintaining something akin to the traditional rotating backup system is definitely manageable. This is the one for us.

CD-ROM Backup

The most essential requirement is to have a working and reliable CD burner. Any current Linux distribution has the required tools, and to minimize media costs, about $4 supplies two good quality CD-RW disks. For daily backups, these will last for about five and a half years, and used weekly, they will last for eternity.

The scheme proposed here is to use the two CD-RW disks to take backups in rotation. In my actual implementation, I have color-coded the spine of the disk covers red and green, respectively, to aid in the correct rotation.

We also require the backup disk to self-boot into a minimal working Linux system. This is necessary to ensure that we can re-establish the master boot record (MBR) and the rest of the original partition information, if required. This rules out using a boot disk image, as commonly supplied with the majority of distributions. These supply only a boot method and a Linux kernel, and they usually boot straight to the partition they are customized to boot.

After a quick perusal of the Linux on self-boot CDs available, I settled on using the classic and well tried TomsRtBt disk in a 2.88MB image format. This is not an ISO image, but it is suitable for being the boot image of an ISO we will burn. It is also to be found at various other sources on the Web. I have used this self-boot in the floppy format, and it is good and quite complete. Note that it also includes a Toms FAQ.

In order to restore our working Linux system to a given state, we need to have records of all the current directory contents that are changing on a day-to-day basis or have changed as customizations since the initial install. This can be done laboriously by inspection and detailed lists, which minimizes what must be restored. Or, it can be accomplished easily by backing up the entire contents of these directories.

In my case, I have decided to back up the entire contents of */home, /etc, /usr/local, /opt, /var, /root and /boot* on the Slackware 8.1 partition:

  • /home holds all of the files for each user

  • /etc holds all of the configuration information

  • /usr/local normally holds any extra programs added since the install

  • /opt is commonly used by applications to install files

  • /var holds all data of a variable nature

  • /root belongs to the root user and has essential customizations

  • /boot has all the files for booting the system and boot .conf files

In addition to the contents of each of the identified directories above, there are some more important pieces of information that one wouldn't want to be without if a sudden failure to boot occurred. These include a binary copy of the MBR, a text list of the partition table and a copy of the fstab file, in case you have forgotten which partitions correspond to which filesystem. Optionally, you could make a copy of the current XF86Config file and/or the text output of commands such as lsdev and lspci for full system information.

Also, how are we going to structure all of this information to ensure it gets onto the CD in such a way as to be completely self-contained and usable for the task at hand? Here is what I did. First, I created a directory to hold all of the information to back up. As root, I issued /mkdir /tmp/backup/. Note here that I am using /tmp as repository for the constant part of the backup CD. This is safe in Slackware, but it might not be in other distributions. Choose a safe location, and one not itself backed up by the tar file.

Put into the backup directory a copy of the TomsRtBt .img file


cp ./tomsrtbt288.img /tmp/backup/tomsrtbt288.img

Here the .img file is in my home directory.

Put into the backup directory a copy of the master boot record:


dd if=/dev/hda bs=512 count=1 > /tmp/backup/MBR.bin

The MBR holds the first stage of the boot mechanism you employ. In my case, that's stage1 of GRUB, the GRand Unified Boot Loader, or LILO, s well as the partition information for the primary partitions. The extended partition information is held elsewhere on the disk and can be restored--if required--with the information you store from the fdisk command detailed next.

Put into the backup directory a list of the partition information:


fdisk -l > /tmp/backup/Partition_Table

This will be used to compare with a Toms listing of the partition table before any restoration takes place.

Put into the backup directory a copy of fstab, which defines the file system mount points. Be aware that any errors here will make the files and devices inaccessible later:


cp /etc/fstab /tmp/backup/fstab.bak

Optionally, copy any other information you wish to have available to you before you are able to boot into your newly restored Linux system. For easy accessibility, I keep a copy of XF86Config on the disk to ensure that I always can set up X the way I like, even if I'm installing a new system upgrade. I also keep a copy of menu.lst, as I use GRUB as my boot loader of choice:


cp /etc/X11/XF86Config /tmp/backup/XF86Config.bak 
... 
cp /boot/grub/menu.lst /tmp/backup/menu.lst.bak

These files are added to every copy of the backup disk that is burned. The disks need to be changed only if one of the files changes, and then it should be copied over.

Now we need to ask: what do we need to do to create our self-booting backup disk? Here's the procedure I used:

  1. Create a compressed tar file of chosen directories and add it to /tmp/backup.

  2. Create a bootable ISO of the backup directory by using mkisofs.

  3. Check the size of the ISO to be sure it will fit on your chosen CD-RW disk.

  4. Burn to CD-RW using cdrecord.

  5. At appropriate stages, echo messages to standard out, such as md5sums and so on.

  6. Clean up the files no longer needed.

The script to accomplish all of these steps is shown below. Be sure to make it executable--chmod 755 ./backup--and copy it to somewhere in root's PATH; /usr/local/bin is a good place. Do the same for the next script as well.


#!/bin/bash
#  backup
#------------------------------------------------------------------------------
#  Script to enable easy backup of all important Linux files
#  and also creates a customized system repair disk.
#  Uses two CD-RW Disks labled "RED" and "GREEN to rotate backups
#------------------------------------------------------------------------------
# The backup directory already contains files for boot and recovery.
# One can add more - my Slackware 8.1 system backup is < 580MB.

Backup_Dirs="/home /etc /usr/local /opt /var /root /boot"
Backup_Dest_Dir=/tmp/backup
Backup_Date=`date +%b%d%Y`
Image_File=/tmp/backup.iso
declare -i Size

# Create tar file with todays Month Day Year prepended for easy identification
tar cvzf $Backup_Dest_Dir/$Backup_Date.tar.gz $Backup_Dirs &> /dev/null

# Start backup process to local CD-RW drive
echo "Backing up $Backup_Dest_Dir to CD-RW Drive - $Backup_Date"
echo "Creating ISO9660 file system image ($Image_File)."

mkisofs -b toms288.img -c boot.cat -r \
        -o $Image_File $Backup_Dest_Dir  &> /dev/nul

# Check size of directory to burn in MB
Size=`du -m $Image_File | cut -c 1-3`
if [ $Size -lt 650 ]
then
   echo "Size of ISO Image $Size MB, OK to Burn"
else
   echo "Size of ISO Backup Image too Large to burn"
   rm $Backup_Dest_Dir/$Backup_Date.tar.gz # Remove dated tar file
   rm $Image_File   # ISO is overwritten next backup but cleanup anyway
   exit 1
fi

# Burn the CD-RW
Speed=4                 # Use best speed for CD-RW disks on YOUR system
echo "Burning the disk."
                              # Set dev=x,x,x from cdrecord -scanbus
cdrecord -v speed=$Speed blank=fast dev=1,0,0 $Image_File &> /dev/null
Md5sum_Iso=`md5sum $Image_File`
echo "The md5sum of the created ISO is $Md5sum_Iso"

# Could TEST here using Md5sum_Iso to verify md5sums but problem is tricky.
echo "To verify use script md5scd, this will produce the burned CD's md5sum"
echo "run this as User with backup CD in drive to be used for recovery."
echo "This verifies not only the md5sum but that disk will read OK when needed."

# Remove image file and tar file
echo "Removing $Image_File"
rm $Image_File
echo "Removing : $Backup_Dest_Dir/$Backup_Date.tar.gz"
rm $Backup_Dest_Dir/$Backup_Date.tar.gz
echo "END BACKUP $Backup_Date"
echo "Be sure to place this backup in the RED CD case and previous CD in GREEN"
echo "------------------------------------------------------------------------"
exit 0

Using the Backup System

Once established, the backup process is simple. I usually back up every day. If I'm not doing much on the system, then I back up every week instead. At the start of every backup, I place the CD-ROM from the green CD case into the CD burner. In an xterm I su to root and issue this command:


nohup backup &> /tmp/backup.log &/

and then close the xterm and go to bed. The backup takes about 15 minutes to complete, so it can be done at any convenient time in a work day. When next at the computer, I cat /tmp/backup.log and check that the backup went well.

If I also want to verify the backup ISO, I note down the first and last four or five letters of the listed ISO md5sum. As my burner does not reliably read back the CD just written, I transfer the CD to my CD-ROM drive and verify that the md5sums are identical, using the script md5scd (see the listing below). If they are identical, I put that newly burned CD into the red case and the last burned CD into the green case, ready for the next backup cycle. If any possibility of confusion exists, one can always check the date of the tar file. Note that because of the burner not reliably reading the backup CD, I have not included an automatic check of the md5sums. I did this because failure to validate does not mean the CD is in error, only what was just read from the burner was in error. In fact, I have never experienced a md5sum compare failure when using my CD-ROM. I consider the MD5 checksum to be essential, as even a single-bit error conceivably could corrupt the entire compressed archive.


#!/bin/bash
#------------------------------------------------------------------------
# md5scd ---- Data CD md5sum Verifier
# Script to automate determining Md5sum for ISO9660 CDs
# NOTE - This script assumes that correct md5sum is known and one wishes
# to verify that a particular CD copy has been burnt correctly.
# If working from a downloaded ISO image use "md5sum ISO" at command line
#------------------------------------------------------------------------
# Requires standard tools found in all Linux Distributions
# If script invoked as user, check all permissions, groups, etc.

# Missing arguments?
if [ $# -ne 2 ]
then
  echo "Usage - md5scd mountpoint device, ex - md5scd /mnt/cdrom /dev/hdc"
  exit 1
else
    : OK have arguments
fi

# Loop over md5sum determination ...100 good copies for install-fest?
again=yes
while [ "$again" = yes ]
   do
     echo "Please insert CD at $1 and press ENTER when ready"
     read                        #Wait for insertion of disk
     mount $1
     Block_Count=`df -k $1 | grep $1 | cut -c 25-30`
               #700Mb disk cannot exceed this ^^^^^ column limit in 1k blocks
     umount $1
     Md5sum_Cd=`dd if=$2 count=$Block_Count bs=1024 | md5sum`
     echo "The md5sum of the CD at $1 is " $Md5sum_Cd
     echo
     echo -n "Verify another CD? [yes/no]"
     read again   # Wait for "yes" -> repeat, anything else -> drop through'
   done
exit 0

What Do I Do If My System Crashes?

Before that eventuality occurs, one should make sure the backup disk will boot. Also, make sure you understand the limitations of tomsrtbt, and practice reading the various files placed on the backup disk, as the only editor available there is Vi. When you need it, the disk first has to be mounted:


mount -t iso9660 /dev/xxx /mnt

It is possible to unzip and untar the tarred file using TomsRtBt by first using gzip and then tar. However, it probably is better to first check that the partition table is correct by using fdisk -l and a reference to the stored table. If not, to restore the MBR use:


dd if=/mnt/MBR.bin of=/dev/hda bs=1 count=512 

This restores the primary partitions and the bootloader. Then, use fdisk and the partition table file to restore the extended partition manually along with the logical partitions within it. This all requires nerve and practice! However, any changes can be abandoned if you're not sure or are only practicing.

Next, do a clean install to the proper partitions. Reboot to the point where one has a root console, mount the backup CD and execute


tar xvzf /Mount_Dir/Backup_Tar_Filename

This restores all of the previous directories to their correct places. It should leave you with an almost fully restored system.

Note that if the problem is only lost or corrupt files, one also can restore any of the saved directories at any time by extracting with, for example:


tar xvzf /Mount_Dir/Backup_Tar_Filename /home

The Proof of the Pudding

The test of any system is, "Does it work?" I initially verified that the backup CD does boot into Toms wonderful Linux system, that all of the text material was readable and that fdisk -l did correspond to the stored version. I did not reinstate the MBR from the binary image file, but it is there if I ever need it.

The final test was to restore my Slackware 8.1 system in place of the original Mandrake 9.0 system, before installing Windows and perhaps having to restore. In brief:

  1. I changed menu.lst to reflect the fact that we now would boot Slackware not Mandrake and formatted the partition, mke2fs -j /dev/hda1.

  2. I rebooted with the Slackware install disk in the drive and the BIOS set to boot from CD-ROM. In 15 minutes, everything was installed.

  3. I rebooted into the new system, and at a root console I mounted the last backup CD to /mnt and issued tar xvzf /mnt/last_dated_backup.tar.gz.

In another five minutes, this reinstalled all of the backed up partition contents. A reboot now brought me into a restored Slackware 8.1 with X set up and a KDE login. Because of not saving /dev, some of the device permissions had to be reset--sound and so on--but this was trivial. The whole process took less than half an hour, a far cry from doing a normal install and adding all of the missing favourite programs, followed by a lengthy reconfiguration.

Conclusion

Backup is easy to do and easy to keep doing. Now that the system is in use, I see that a number of small improvements could be made. The manual backup and verification commands could be made shell variables and invoked with a single word. Also, if the total file size becomes a factor, one could use the --exclude option of tar to not include large sections of invariant code in the tar file. Alternatively, one could use bzip2 compression. As it is now, complete directories from root are saved.

The urgent need for the Windows applications turned out to be not so urgent, but the occasion gave me the prod I needed to actually back up regularly. Perhaps my next project will be to install Wine and try to get those pesky applications to run within Linux, without the need to always reboot.

I would be interested in any comments for improvement. Indeed any feedback would be welcome, particularly if glaring flaws or omissions are evident. This scheme has been in use for only a short time, but so far I'm very satisfied. Finally, I encourage you also to institute regular backups. If you want a quick ready-made approach, try this one. A few changes to the scripts should have you backing up today and everyday after that.

Copyright (c) 2003, Alan Keates. Originally published in Linux Gazette issue 91. Copyright (c) 2003, Specialized Systems Consultants, Inc.

A retired control systems engineer, Alan spent much of his career designing and implementing computerized control and shutdown systems for Canada's CANDU Nuclear Reactors. A programmer for over 40 years and a Linux enthusiast since 1994, his first log entry shows 7.83 Bogomips on a 386 DX33 machine still running. Linux and golf are in first and second place among many other hobbies.

__________________________


Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Sorry, offer available in the US only. International orders, click here.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

After restore linux won't boot

On July 1st, 2008 smoky (not verified) says:

I am trying to recover my SLES ENT Server 9 from a tar backup. I have successfully restored the MBR and created the paritions and restored the full system using tar. When I try to boot the system after a restart I get the following error:

graphics file (hd0,1) /Message" Missing, press any key to continue"

I hit a key to continue and get the grub boot menu. I try to boot to linux but I get the following error:

Error 15: File not Found

Any ideas I can't seem to find any information on how to go further.

Thanks

Hard disk

On November 20th, 2006 Ferienhaus Ostsee (not verified) says:

I think the new hard disks are the best way to recover your data..

Backup

On June 7th, 2006 Serg (not verified) says:

I think as alternative for backup it is possible also to use Flash Memory Cards.
10 Years average guaranteed term of a storage of the data.

Use Flash Memory Cards

On October 30th, 2006 Autobusy (not verified) says:

Nice work on top of that it’s really helpful..

re

On October 14th, 2006 katalog (not verified) says:

Shouldn’t a mistress city give some sort of seclusion and msytery to its visitor? If so how ‘bout Park City, UT? High up in the mountains but still a very engaging and inspiring city for creatives. Dear old Philly would never think to look there…

Thanks for this!

On June 5th, 2006 spielen (not verified) says:

Thanks for this!

more flexible way to check size of cd/dvd in the script

On May 4th, 2006 nicholas biondi (not verified) says:

Great script my-man!
One minor thing I might add though, the line:

Size=`du -m $Image_File | cut -c 1-3`

is better served with the -f flag:

Size=`du -m $Image_File | cut -f1`

This way if your dvd is let's say 4700 mb's it still works. -f1 picks up the first field instead of the -c which parses characters.

shwoot!
-nicholas biondi

My way

On December 10th, 2005 David Sutton (not verified) says:

I keep a second identical hard drive on a removable drawer. Once a week I install it in the PC and run G4U disk mirroring software from a bootable CD. For a local disk copy I do the command "copydisk wd0 wdx" (x is the ordinal number of the destination disk) and it takes about 15 minutes. Free, quick, simple, OS-independant, and backs up all partitions at once.

Advice for young players: G4U can be dangerous if you have multiple working hard drives. You must be VERY careful to get the drive names (wd0, wd1, wd2) correct : otherwise you may find yourself backing up over a working drive, and the moment you realise its happening, it's too late.

If I need to restore from a drive failure, I would have to physically swap the backup drive for the failed drive, changing jumpers to make it the master drive along the way. If you need to restore individual files, just plug in the backup drive, and copy your backup files over to the working drive.

G4U also provides for backing up to another drive across a network, which avoids moving the backup drive around. Personally I like using the removable disk drawer as it provides protection from theft and other calamities. USB connected external hard disk housings would also work well and be a tad easier.

DVD instead of CD?

On December 5th, 2005 Allen (not verified) says:

Please help me...

What if I want to use DVD instead of CD?

How do I change the script? Does cdrecord write to DVD as well as CD?

If not, what do I use?

Thanks and take care,

Allen

Use rdiff-backup and pyBackpack

On November 28th, 2005 Anirban (not verified) says:

Here is my setup:

  • Fedora core 4 on x86_64
  • 2x160GB on LVM makes primary storage
  • 1x200GB on LVM makes backup storage
  • rdiff-backup
  • pyBackpack
  • Samba 3.0.x providing primary storage as mount points to my PCs.

This setup works quite well. I can save data from my PCs into the network mounted drive on the linux server and all the data is transparently backed up. It takes incrementals and is able to restore history.

Free professional backup solution from Arkeia

On November 27th, 2005 Anonymous (not verified) says:

Arkeia offers a no-cost license (up to 50GB) of its Linux based backup software, allowing both backup to disk and to tapes. This solution also brings network backup of Windows, xBSDs, Mac...

Download available from arkeia.org

ZIP as an alternative

On November 23rd, 2005 Richard (not verified) says:

I have been using "find" and "zip" in combination for backups for years. And my main motivation for using zip instead of tar/gzip is your observation that "even a single-bit error conceivably could corrupt the entire compressed archive". Tar/gzip archives are great for distributing source packages, where you can simply get a new copy if yours goes bad, but they're not as good for backups.

Bit errors in a zip archive typically will make only the one file unrecoverable. And note that bit errors may develop over time -- just because your archive passes the md5sum check today, it might not in a year. CDs have an expected shelf life of 100 years, but remember, that hard drive that failed had a MTBF of 100,000 hours.

True

On November 24th, 2005 Ashley Bowers (not verified) says:

Yea I have yet to recover a bad file yet!

mbr equivalent for lvm?

On November 23rd, 2005 Chris (not verified) says:

What would be the equivalent to the 'dd' statement for storing the layout of an lvm setup? Is it stored i a regular file, or is there a chunk of disk that needs copying?
(I don't have access to a linux box at the moment to investigate the answer for myself.)

Rsnapshot

On November 23rd, 2005 Anthony Ettinger (not verified) says:

How could you have not mentioned rsnapshot? ;-)

www.rsnapshot.org

Good tips on rolling your own

On November 23rd, 2005 Bruce Martin (not verified) says:

Thanks for a fine article on how to roll your own solution.
I have been using Hugo Rabson's MONDO from www.mondorescue.org to create backup disks for years. I think Hugo's code started with what you are doing here but has expanded. It still retains the kind of flexability and ease of use for personal backups. It has the capability to create CD-R, CD-RW, DVD-RW, ISO images, backups to NFS volumes and even to tape.

A CD-RW is far too small.

On November 23rd, 2005 Anonymous (not verified) says:

Im sure it's nice, and all, but what about people with 160GB drives?

My collection of digital photos I've taken takes about 10GB alone.

I just have to trust in XFS and Western Digital :(

Well, if you value your

On November 26th, 2005 Anonymous (not verified) says:

Well, if you value your data, you should be buying a backup solution as part of your computer investment. So, if you can spend extra on a 300G hard drive, you should probably instead buy 2 160G hard drives, for instance. The price vs. size vs. quantity thing isn't quite that simple, but you get the idea. Backup solutions are not an "extra" thing; they're part of your basic costs. If you can't afford a backup system, then you can't afford the computer at all.

But, at the very least, partition the drive, and backups to the other partition with rsync or something like dirvish, as mentioned elsewhere.

re... too small

On November 23rd, 2005 Anonymous (not verified) says:

I have the same problem. I have about 2 GB of saved docs and email, 3 GB of digital pics and about 10 GB of music that I don't want to get lost. I have the cd's for most of the music (yes I do own it) but to get it back onto the hard disk I would have to rip for a week.

My solution:
1) Grab an old pc out of the garage (PPro 200MZ in this case)
2) Install 3 of the biggest disk drives I had laying around.
2) Install Linux (RedHat 7.3 with all the Fedora Lagacy patches)
3) Plug it into the network. ( We now have NAS)
4) Set up rsync to backup nightly. (rsync only sends files that have changed)
5) Set up Samba to allow the wife to save her "My Documents"

Scripts:

$ cat sunday_sync
#!/bin/bash
sun_sync_doc_with_ast
sun_sync_pic_with_ast
sync_dudley_with_ast
sync_mp3_with_ast

$ cat sun_sync_doc_with_ast
#!/bin/bash
cd /home/me/
rsync -avz ./Documents me@192.168.1.50:./Doc1

$ cat sync_mp3_with_ast
#!/bin/bash
cd /home/me/Music
rsync -avz ./mp3 me@192.168.1.50:./Music

(you get the idea... I rsync nightly to this machine. I also have more then one directory on the target machine for doc and pic ... ie. ./Doc1 ./Doc2 ./Doc3 .... and rotate through the week. )

Notes:

You will notice that I have several copies of ./Doc on the backup server but only one copy of ./Music . Music doesn't change that often and if I did lose it it would be more of a hassle then a disaster. (You get extra points for making sure that ./Doc1 is on a different hard disk then ./Doc2 is on a different hard disk then ./Doc3)

In order to make the rsync happen with out my having to imput passwords I created an ssh key with no password. This is a little bit of a security hole but since this is sitting in my home office and you would have to hack my main pc to access the key... oh well. Even if you did this key is only used for the backup machine.

I choose RedHat 7.3 for the following reasons.
1) I had the disks sitting in my drawer.
2) With the Fedora Lagacy project putting out security updates it is as secure as any other version of RedHat.
3) Version 7.3 runs great on this old Pentium Pro 200. 7.3 was the high point for RedHat. It was fast, complete, stable, and ran well. Every version since has gotten more and more bloated and slower and slower on anything except "state of the art" hardware. In my opinion they are close to if not already living in Microsoft Bloatsville. RedHat needs to force their developers use 500MZ Pentium II machines for their desktops.

if you want rsync web

On January 28th, 2006 Anonymous (not verified) says:

if you want rsync web interface or gui tools check this very useful

rsync web interface or gui tools

Have a look at dirvish.you

On November 25th, 2005 Anonymous (not verified) says:

Have a look at dirvish.
you can use it on your local computer and via the network. it also uses rsync for transferring the data, but you can keep multiple backups of your data wihout wasting space for common files. this is achieved by using hardlinks for common files. it also provides indexing and search functionality. I use it for several months on our servers and had no problems...

Yes. Something like Dirvish

On November 26th, 2005 Anonymous (not verified) says:

Yes. Something like Dirvish is ideal, I think. Optical media is far too unreliable for backups, imho. At best, they're useful for shipping data or transferring to a non-networked machine. I was using faubackup for a while, to transfer from one machine's HD to another's, but dirvish is similar, only faster; just got finished setting it up myself. It's a little more complex than faubackup (which would still be useful for very simple backups or backups to the same machine), but not too difficult to get your head around, and quite flexible and powerful too.

A CD-RW is far too small.

On November 23rd, 2005 Tom Simonsen (not verified) says:

For large amounts of data, an external USB2 or firewire drive is the only practical way to go.

It should be possible to modify this script to use an external USB disk instead. For rotation and "security" use multiple directories or partitions.

I think you switched the bs

On November 23rd, 2005 Anonymous (not verified) says:

I think you switched the bs and count #'s to restore the mbr.

D#ont use a CD-RW

On September 4th, 2006 Bob (not verified) says:

Correct, the only way is to use an external USB2, don't use a CD-RW, it's not suitable for data in large amounts.

External USb2 and firewir drive

On September 4th, 2006 Hilde (not verified) says:

Hi Bob, you are correct in your statement, but a firewire drive is also
possible.
Best regards Hilde from Germany

I read some articles and

On September 9th, 2006 Dobby (not verified) says:

I read some articles and learned a lot from your journal. Thank you and success for the future.
Best wishes
Dobby

Interesting articles

On October 12th, 2006 Carsten (not verified) says:

By reviewing your articles I can found out the same as Dobby(see his comment on September 9). I like your journal, especially the content but also the design.
Success in the future
Carsten

Thanks

On November 9th, 2006 Robert (not verified) says:

A helpful script for external USB!

By modifying the script use

On November 20th, 2006 Heinz (not verified) says:

By modifying the script use an external USB disk instead.
best regards
Heinz

my comment before

On November 20th, 2006 heiz (not verified) says:

sorry, my homepage behind my name heinz in not running. therefore
i try it again.
best regards
heinz

Easy backup

On November 20th, 2006 Diddi (not verified) says:

Easy backup and restore is a neverending story. I like the comments, helpful for my work.

Featured Videos

Email is one of the least private and least secure forms of communication, although few people realize this. MixMaster is one way to allow secure, anonymous communication even over the very public medium of email. This tutorial will get you started with MixMaster quickly and easily.

In case you were wondering about the fun side of Linux World Expo, we thought we'd give you a peek at our shenanigans. We at Linux Journal love what we do so much, that we can't help but have a ball wherever we go.

From the Magazine

September 2008, #173

Feeling a bit like a Thermian? Never give up, never surrender! Someday, you could go from underdog to top dog. Just take a look at a few of the underdogs we highlight in this issue: Mutt, djbdns, Nginix, Gentoo, Xara and the program voted mostly likely to fail just a few years back—Firefox. If Firefox is not radical enough for you, check out Chef Marcel's column for some more alternatives. Having trouble mapping your program data to your relational database? If so, Rueven Lerner shows you some tricks in his At The Forge column.

Need to run GUI applications on your server in the next state? In his Paranoid Penguin column, Mick Bauer shows you how to do it securely. Kyle Rankin keeps hacking and slashing and shows you a few split screen secrets you may not be familiar with. Finally, we all know what happens next February, but only Doc knows what happens afterward.

Read this issue