]> git.sur5r.net Git - bacula/bacula/blob - bacula/examples/vm/blabela.exec
Split docs out of bacula.spec
[bacula/bacula] / bacula / examples / vm / blabela.exec
1 /* REXX ****************************************************/
2 /* BLABELA EXEC -- Example VM procedure for labeling tapes */
3 /*                 to be used with Bacula in ANSI label    */
4 /*                 mode.                                   */
5 /*                                                         */
6 /* Author:         David Boyes <dboyes@sinenomine.net>     */
7 /*                                                         */
8 /* Prereq:         Tape drive attached at virtual addr     */
9 /*                 181 (TAP1).                             */
10 /*                                                         */
11 /*                 Blank tape inserted in drive.           */
12 /*                                                         */
13 /*                 External file BACULA DATA (used as a    */
14 /*                 dummy input file for MOVEFILE, since    */
15 /*                 MOVEFILE insists on having a real file  */
16 /*                 for input if we want actual output      */
17 /*                 by the CMS OS sim routines).            */
18 /*                                                         */
19 /* Usage:          BLABELA volumeid ownerid                */
20 /*                                                         */
21 /*                 where:                                  */
22 /*                                                         */
23 /*                 volumeid = ANSI volume id to be         */
24 /*                     written in VOL1 label and made      */
25 /*                     visible to the library automation   */
26 /*                     and other OSes.                     */
27 /*                                                         */
28 /*                 ownerid  = local userid to "own" the    */
29 /*                     tape from the TMS viewpoint. Used   */
30 /*                     to validate mount requests and for  */
31 /*                     TMS housekeeping purposes.          */
32 /*                                                         */
33 /* Maintenance Log:                                        */
34 /*                                                         */
35 /* 16 Feb 2005 --  DB: Created procedure and released to   */
36 /*                     Bacula development list.            */
37 /*                                                         */
38 /*                                                         */
39 /*                                                         */
40 /*                                                         */
41 /*                                                         */
42 /*                                                         */
43 /***********************************************************/
44  
45 /***********************************************************/
46 /* Parse command line arguments                            */
47 /***********************************************************/
48  
49 arg volser owner
50  
51 /***********************************************************/
52 /* Rewind tape and write ANSI VOL1 label and logical EOT   */
53 /***********************************************************/
54  
55 'TAPE REW (TAP1'
56 'TAPE WVOL1' volser owner '( TAP1 AL'
57 'TAPE WTM 2'
58  
59 /***********************************************************/
60 /* Rewind tape and write Bacula ANSI label signature file  */
61 /* (HDR1 file containing BACULA.DATA FID as 1st file on    */
62 /* tape). Note that for some reason the LABELDEF command   */
63 /* requires FIDs longer than 8 chars to be passed via the  */
64 /* program stack, even if it would not cause the resulting */
65 /* command to exceed the 255 char maximum. This is (IMHO)  */
66 /* an APARable bug, but c'est la vie.                      */
67 /***********************************************************/
68  
69 'TAPE REW ( TAP1'
70 'SET CMSTYPE HT'  /* supress output to hide prompt for FID */
71 'FILEDEF INMOVE DISK BACULA DATA A'
72 'FILEDEF OUTMOVE TAP1 AL ( RECFM F LRECL 80'
73 queue "BACULA.DATA"
74 'LABELDEF OUTMOVE FID ? VOLID' volser 'VOLSEQ 1 FSEQ 1'
75 'MOVEFILE'
76 'SET CMSTYPE RT'  /* resume normal console output          */
77  
78 /***********************************************************/
79 /* Print nice exit message and exit                        */
80 /***********************************************************/
81  
82 say "Labeled ANSI" volser "for use with Bacula."
83 exit