Using Hostdump.sh

To back up one or more UNIX systems, simply give the script their names. It will automatically determine the names of all their file system and back them up to the tape drive device that you specify. Issue the following command:

# Hostdump.sh level device logfile system [system2 … systemx]

Sometimes you don't want to back up an entire system. To back up less than the entire system, add the name of the file system(s) that you want after the system name. If you want to back up more than one file system from the same system, you will need to specify the system name before each file system. Issue the following command:

# Hostdump.sh level device logfile system:/filesys system:/filesys

level

A valid dump level between 0 and 9

device

A non-rewinding tape device, such as /dev/rmt/0n, or /dev/nrmt0. (The script will test to see if the device you specify is actually a no-rewind device.)

logfile

This will be an absolute pathname to a logfile that will contain stdout & stderr from script. This pathname should be a name that can be associated with the tape. When I used this script for production backups, I named the tapes and the logfiles after the name of the system, tape drive, and level. You could use something like this:

/backuplogs/apollo.DevRmt0n.Level0.12.13.1996

system1 [system2 … systemx]

This is a list of one or more systems that you want the script to back up to the device you listed with the second argument. Each system you list will be written to the tape, in the order they were listed. The script will automatically look at each system’s fstab file, and create a list of file systems to be backed up.

system:/filesys [system:/filesys]

If you are backing up the whole system, it is best to use the option above and have Hostdump.sh figure out which file sytems to back up. But if you want to limit the file systems included, you can list as many as you want in this format.

system1 system2 system3:/filesys system4:filesys

You can also mix and match the options like this. Any systems that are listed without an accompanying file system name will receive a full backup. Any systems that have a file system listed after them will only have that file system backed up.

Advanced Option 1: Special Case File Systems

You may have file systems that are listed in the fstab file that you want to exclude on a regular basis. Or you may want to back up the /tmp file system, which is normally excluded by Hostdump.sh. Hostdump.sh can handle both of these special cases. If you want to exclude file systems that would normally be included, you put that file systems’s name in a file called fstab.exclude, on the system where you want to exclude it. (For fstab, you need to substitute whatever that version of UNIX calls the fstab file. For example, you would use /etc/vfstab.exclude on Solaris.) To include file systems that are not in the fstab file, or are normally excluded by Hostdump.sh, put that file system’s name in a file called fstab.include, on the system where you want to include it.

For example, assume that on a Solaris system called apollo, you want to exclude the /home file system. Normally it would get backed up since it is in /etc/vfstab. Suppose that you want to include the /tmp file system. You would create two files on apollo.

One would be called /etc/vfstab.exclude, and it would contain the entry:

/home

The second file would be called /etc/vfstab.include, and it would contain the entry:

/tmp

Advanced Option 2: Systems Bigger Than a Tape

Hostdump.sh, like the dump and restore commands, was not originally designed with today’s systems in mind. The script was first written to back up Ultrix systems (the largest of which was 7GB at the time) to 8mm compressed drives (the smallest of which was 10GB). The original author never envisioned a system where the disk was bigger than a tape. Then Hostdump.sh (and I) met HP’s that shipped with 20GB of disk and one 6GB DDS tape drive! Something had to be done.

The "NOTE" should begin here.

    1. This is where backup philosophy enters again. Please remember the essential elements to a good backup

 

The "NOTE" should end here, but the >bullets go outside of it.

The easiest thing would be to scrap the original idea of looking at the fstab, and give it a list of file systems to back up. That would be an easy option to include, and the job would get done. Essentially, that’s what I’ve done, but with a twist. I recommend doing it in the following manner:

Why is it important to do it this way? It goes back to the second essential element of a good backup –intelligence. Say, for example, that you have only had two include lists. You tell Hostdump.sh to backup /, /usr, /var, /opt, and /home1 on one tape, and /home2 and /home3 on another. What happens when you add /home4? Unless someone or something tells the backup program, it will never get backed up. You’ll never know it either, until someone asks you to restore /home4/yourboss/really-important-presentation-to-the-board-of-directors.doc. So, whenever you are in a situation like this, whether you are using this program or not, you need to find a way to back up the entire system on one tape drive (excluding certain file systems), then back up the excluded file systems on another tape. That way, when you add /home4, it will be automatically included on the first tape. The worst thing to happen is for the new /home4 fills up your first tape (which you would immediately know because you monitor your backups, right?), and you have to manually add it to the second tape and exclude it from the first.

To use this option, run hostdump.sh a second or third time, specifying the file systems that were excluded in fstab.exclude. It is easier to explain this option with an example. In this example, elvis is the name of the Solaris system you want to back up. You are using Hostdump.sh for the first time, and you know that a full backup will fit onto three different tapes. You have divided up the file systems equally in the following manner:

Tape 1: OS file systems (/, /usr, /var, /opt, etc.), /home1

Tape 2: /home2, /home3, /home4

Tape 3: /home5, /home6

 

  1. First back up the whole system, excluding /home2-6, on the first tape.

/home2

/home3

/home4

/home5

/home6

 

  1. Second, back up the other file systems on other tapes. Run these two commands every night:

# Hostdump.sh level device2 blocking-factor logfile2 elvis:/home1 elvis:/home2 elvis:/home3 elvis:/home4

# Hostdump.sh level device3 blocking-factor logfile3 elvis:/home5 elvis:/home6