|→||1.5 File and directory tools|
Backup media management
|Set names file|
|Media number file|
|Media report file|
|Copyright and license|
dk-bmm [options] [file]
The dk-bmm program simplyfies backup media management.
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.
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 dk-bmm program performs the following four operations:
0 on success, all other exit status codes indicate an error.
Imagine a university faculty file server. We have the following backup sets:
|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:
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...
A set names file contains the names of backup sets. All names
are written in the first line, separated by spaces. The set names
must not contain spaces or tabulators.
The second line is added by the dk-bmm program, it contains the index of the current set to process (0 if the line is not yet present).
The media number file consists of the following lines:
The media report file contains the following information for a media set:
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.
This program was named ``tape'' in version 2.x.x, in version 3.x.x the functionality was available in ``dkt tape''.
See the Legal stuff page for copyright and license information.