Amanda-Users

Printing tape labels

2004-02-12 19:27:00
Subject: Printing tape labels
From: Josef Wolf <jw AT raven.inka DOT de>
To: amanda-users AT amanda DOT org
Date: Fri, 13 Feb 2004 01:22:16 +0100
Hello folks.

I have written a script to print amanda tape labels. I think this script
might be interesting to other amanda users, so I offer to include it in
the amanda distribution.

I wrote this program because I was dissatisfied with the original label
printing program that comes with the amanda distribution. I wanted to see
from one glance on the newest tape which tapes in which order I need to
recover a specific DLE.

This program prints tapelabels for the amanda backup system. The output
can be in plain ASCII or in postscript. The postscript output is formatted
so that it can be folded to fit into a DAT case or into a CD jewel case.

An example ASCII output (somewhat stripped to make it fit into 75 columns)
is attached below. Here is an explanation of the example output:

The output is split into four sections. The first section contains only
one line with date, label and amount of data on the tape.

The second section lists all the tapes that are needed to recover all
DLEs. In the example below we can see that four level0, three level1
and one level2 from tape VOL09 are needed to do a full restore of all
DLEs. In addition, one level0 and two level1 from VOL08 are still needed.
Everything else on VOL08 is obsoleted by the dumps on VOL09. VOL07 and
VOL06 each contain two level0 dumps that are not obsolted by newer tapes.
Tapes that contain only obsoleted data are not mentioned at all.

The third section is the main section and is itself split into multiple
sections, one for each DLE. In this section we can see which tapes we need
to recover a specific DLE. For example, we can see that in order to recover
raven:/usr we need file 9 from VOL07, file 5 from VOL08 and file 4 from VOL09.

Finally, the fourth section lists errors. In this case level1 from raven:/u3
was not written to tape, requiring an amflush run.

Here is the example output:

   2004-02-05   VOL09   Total size: 858M
   
   2004-02-05.0 VOL09 2054M  858M  0:01:14 4/3/1
   2004-02-04.0 VOL08 2369M 1592M  0:01:49 1/2
   2004-02-03.0 VOL07 2629M  878M  0:00:47 2
   2004-02-02.0 VOL06 2545M 1283M  0:02:24 2
   
    Dspd  Tspd Dtime Tsize Osize Ttime date         label:fn L filesystem
    301k  109M 00:09 2882k   14M 00:00 2004-02-05.0 VOL09:03 1 raven:/
    786k   14M 09:00  415M 1122M 00:27 2004-02-03.0 VOL07:08 0 raven:/
   
   2022k  109M 00:01 3485k 4510k 00:00 2004-02-05.0 VOL09:02 0 raven:/boot
   
    135k 1346k 00:00   22k  290k 00:00 2004-02-05.0 VOL09:01 1 raven:/u1
    899k   10M 12:27  656M 1731M 01:02 2004-02-02.0 VOL06:09 0 raven:/u1
   
    840k   45M 02:10  107M  113M 00:02 2004-02-05.0 VOL09:07 0 raven:/u2
   
   2776k   14M 01:17  209M  266M 00:14 2004-02-04.0 VOL08:06 1 raven:/u3
   2569k 7790k 04:09  626M  813M 01:22 2004-02-02.0 VOL06:08 0 raven:/u3
   
    369k   46M 01:10   25M  463M 00:00 2004-02-05.0 VOL09:05 1 raven:/u4
   1490k   12M 15:39 1367M 2023M 01:48 2004-02-04.0 VOL08:07 0 raven:/u4
   
    239k  115M 00:10 2601k   31M 00:00 2004-02-05.0 VOL09:04 2 raven:/usr
    146k   87M 01:45   15M   80M 00:00 2004-02-04.0 VOL08:05 1 raven:/usr
    553k   23M 14:16  462M 1507M 00:19 2004-02-03.0 VOL07:09 0 raven:/usr
   
    975k   16M 06:13  355M  858M 00:22 2004-02-05.0 VOL09:09 0 raven:/opt
   
   1877k   10M 03:18  363M  571M 00:34 2004-02-05.0 VOL09:08 0 raven:/var
   
   Dumps that are not taped yet:
   1 raven:/u3              226M 2004-02-05.0


bugs:
- Parses amanda's log files instead of reading its database.
- Depends on assumption that only one amdump per day is run.
- Nuber of output lines limited to paper size.
- Output formats hardcoded.
- Postscript output is not split onto multiple sheets.
- Error messages should get a better place in CD/DVD postscript output.

todo:
- ignore obsolete log files
- remove some kludges in the code.


Any interest?

-- 
-- Josef Wolf -- jw AT raven.inka DOT de --

<Prev in Thread] Current Thread [Next in Thread>