| ← Previous | ↑ Home | → Next |
dk-bmm [_options_] _file_
The dk-bmm program simplyfies backup media management.
A backup is a set of copies of a file or directory made for security reasons to prevent loss of data.
A backup is never on the same disk as the original file as a failing hard disk will cause loss of original file and copy.
A backup media is normally not available for writing to the computer (except while making backups). Otherwise malicious software could damage the original file and the copies.
A backup media is a storage device (i.e. DVD-RW, tape, or remote directory) used to save the copies.
A media set is a set of 10 such storage devices.
A backup set is a collection of files and directories saved together. Typically a backup set corresponds to a media set.
A backup cycle is a cycle of 200 backup operations on a media set. Each media is used 20 times. After completing a cycle the media differ in age. You always have media 1, 2, 3, or 4 backups old, the remaining media are older.
After completing a cycle you should switch to a new media set but keep the media from the completed cycle.
The following files are involved:
A backup set file contains information about the backup set names and the information which backup set was successfully used previously.
A backup media file for a backup set keeps information about used backup media numbers.
The dk-bmm program performs the following four operations:
| Option | Purpose |
|---|---|
| -s --set |
Request and confirm backup sets. Without this option the program processes media numbers within a set. The file specified on the command line must be a backup set file. |
| -c --confirm |
Confirm a successfuul backup to a media file or set file. Without this option the program asks for the next set name or media number. |
| -r --report |
Write a report, which media number was used at which time. |
0 on success, all other status codes indicate an error.
A backup set file contains one or two lines.
In the first line we have the names of the backup sets in order to proceed them, separated by whitespaces. No whitespaces are allowed in the backup set names.
The second line is created and maintained by the dk-bmm program. The index of the previous successfully handled backup set name is stored here.
For each backup set there is a backup media file containing information about used media numbers.
The first line contains the number of the backup whithin the cycle (1 to 200).
The remaining lines contain use date and number of uses for each media.
This file is created automatically and maintained by the dk-bmm program. At first use of this file you will probably see a warning as the file does not yet exist.
On Windows the file name length is restricted to _MAX_PATH (260) characters if the file name contains a wildcard (* or ? character).
This program uses DK libraries version 4.
Imagine a university faculty file server. We have the following backup sets:
| Name | Description |
|---|---|
| A | Students home directories |
| B | Staff member home directories |
| C | Servers configuration files |
We decide to make copies for set A three times a week, for set B and C once a week.
So our set names file set-names.txt looks like:
A B A C A
Each time we make a backup we retrieve the current backup set name first:
SETNAME=`dk-bmm -s set-names.txt`
Next we have to find the media number within the set:
MEDIANO=`dk-bmm set-$SETNAME.txt`
Now we can ask for the media:
echo Please insert and mount $SETNAME $MEDIANO
Depending on the set name we decide, what to do:
case "X$SETNAME" in
"XA")
tar czf /media/…/A.tar.gz /home/students
;;
"XB")
tar czf /media/…/B.tar.gz /home/stuff
;;
"XC")
tar czf /media/…/C.tar.gz /etc
;;
esac
After finishing successfully we first confirm the media number:
dk-bmm -c set-$SETNAME.txt
Now we confirm the backup set:
dk-bmm -s -c set-names.txt
Finally we write a media number report:
dk-bmm -r set-$SETNAME.txt > report-$SETNAME.txt
In a real-world example one would use automation, i.e. do the backup outside working hours and send the request to insert next tape or media for next backup by e-mail…
| ← Previous | ↑ Home | → Next |