Archive:Printing paper Labels for Streamer Tapes

From SEPsesam
Icon archived docs.png THE CONTENT OF THIS PAGE IS OUTDATED
SEP AG has discontinued support for obsolete SEP sesam versions. Instructions are still available for these SEP sesam products, however, SEP AG accepts no responsibility or liability for any errors or inaccuracies in the instructions or for the incorrect operation of obsolete SEP sesam software. It is strongly recommended that you update your SEP sesam software to the latest version. For the latest version of SEP sesam documentation, see documentation home.

Template:Copyright SEP AG en

Overview

Labeling streamer tapes can be quite a challenge. Unreadable Post-It notes or handwritten labels on the sticker of a tape are unpractical and unsatisfying. Here we present you with a solution for SEP sesam that's laid out for small and medium sized businesses. Usually in KMU environments a streamer tape is inserted daily on which the backup is stored. The tape is then taken out and archived after the Newday event. A small label printer is needed.

Most companies have thermotransfer printers that can create labels or similar things. A popular printer is the Intermec EasyCoder C4, Homepage: http://www.intermec.com/products/prtrpc4/index.aspx . It uses 50 * 26 mm labels. SEP sesam can e configured to automatically print a label with the backup day, date, backup state and tape name at the Newday. Failed backups are highlighted with an inverted label. The Linux shell script wh_print was created specifically to control the C4 printer. This script is called up by sm_notify at the Newday (ALL_JOBS_DONE). The script wh_print evaluates the given parameter and the daily protocol, creates a print file in /tmp and sends this print file to the printer with netcat.

Templates for sm_notify and wh_print are available at http://download.sep.de/utils/Label-templates/

Installation

1. Copy the script wh_print into <SESAM ROOT>/opt/sesam/bin/sesam.

2. Make wh_print executable with chmod 755 wh_print.

3. Edit sm_notify and enter the following code after the term send_mail():

print_label()
{
# prints a paper label for the current tape
# requires the shell script "wh_print"
#
## logging for debug purpose only - remove for production!
##echo "$1"
##logger -f /var/log/messages -i "$0 - Sesam Label: $1"
#
## call wh_print with parameter: message_text
wh_print "$1"
}

4. Further down under case $1 in field enter the following line under ALL_JOBS_DONE:

print_label "$2";. A template of sm_notify is included in the ZIP archive.

5. Edit the wh_print script and enter the printer's IP address (PRINTER=).

Hints

The sesam Newday should occur between 6 a.m. and 8 a.m., i.e. in the morning, and the tape is ejected at the Newday (in sm_notify under ALL_JOBS_DONE with unload_tape 2;). This script prints a label specifically for the tape that's ejected at the Newday. This was tested with SEP sesam 3.4.1.41, Linux under Open SusE 10.2, Intermec EasyCoder C4 203DPI, 50 * 26 mm labels.

Test

To test this you can either execute the wh_print script with a parameter or sm_notify with two parameters. Both options are shown here. Please note that a successful backup has to be created beforehand. Otherwise the daily protocol would be empty and no tape name could be printed onto the label.

Test wh_print with all possible states

wh_print 31 backups completed with 2 broken, 2 failed, 6 with warnings and 21 successful.

test wh_print with OK message:

wh_print All 2 backups completed successfully.

Test sm_notify with all possible states

sm_notify ALL_JOBS_DONE 31 backups completed with 2 broken, 2 failed, 6 with warnings and 21 successful.

test sm_notify with OK message:

sm_notify ALL_JOBS_DONE All 2 backups completed successfully.

A label must be printed for every case. If the tape name is missing then no successful backup was done beforehand.

Adjusting to other printers or label formats

Since this is a shell script adjusting it to other label formats is easy. Adjustment to other printers that print character oriented should also be simple. Controlling printers that need a graphics data stream with a shell script is very difficult.

Problems

We noticed that in some cases no label is printed if single jobs are canceled.

License

Free, We are not liable for damages, use at your own risk.

© 2008 by Walter Hofstädtler Hofstädtler I.E. GmbH A-2700 Wr. Neustadt

office@hofstaedtler.com

http://www.hofstaedtler.com