Hey Monks...I am in need of wisdom:

I am writting this script to see why a given tape goes bad and I am stuck on what seems to be real basic.

Given the below code I have a few questions.

  1. when i open the HANDLE, the one that is commented out doesnt work but i think it should
  2. What would make this work?
  3. At the bottom you will see an example of the logfile I am trying to pharse. I want to find the frozen tapes and want to know why they were frozen, what is the better way to do this?


$date =`/bin/date +'%m%d%y'`; #print $date; my $LOG = "log.$date"; print "$LOG\n"; open (MYLOG, ">/export/home/zmeekins/frozen.txt") or die "Can not open logfile: $!"; #open HANDLE, "/usr/bin/cat /usr/openv/netbackup/logs/bptm/$LOG # | grep FREEZING |") or die "can't get the list"; open (HANDLE, "/usr/bin/cat /usr/openv/netbackup/logs/bptm/log.* | grep FREEZING | +") or die "can't get the list"; # New idea while (<HANDLE>){ chomp $_; ($timestamp, $dummy, $dummy, $dummy, $freezing, $dummy, $dummy, $tapeid, $dummy0, $dummy1, $dummy2, $dummy3, $dummy4, $dummy5, $dummy6, $dummy7, $dummy8, $dummy9, $dummy10, $dummy11, $dummy12) = split; print "I am $freezing $tapeid $dummy0 $dummy1 $dummy2 $dummy3 $dummy4 +$dummy5 $dummy6 $dummy7 $dummy8 $dummy9 $dummy10 $dummy11 $dummy12 \n +"; } #10:46:50.704 [18228] <16> write_backup: FREEZING media id ST6196, it +is unmountable and cannot be used for backups #23:45:21.081 [14993] <8> write_backup: FREEZING media id ST6816, it c +ontains NetBackup database backup data and cannot be used for backups #23:37:51.506 [26186] <8> check_error_history: FREEZING media id ST067 +0, it has had at least 3 errors in the last 12 hour(s)

Code tags added by davido.


In reply to Monks to the rescue by mrbbq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.