#!/usr/bin/perl -w use strict; open(TEST, "< /usr/local/bin/hosts") or die "This file doesnt exist or + cant be opened /usr/local/bin/hosts #!\n"; open(LOGFILE, "> /tmp/log_backup.txt") or die "Can't write to /tmp/lo +g_backup.txt: $!"; $old_fh=select(LOGFILE); chomp($cur_date=`date +\%m\"\/\"\%d\"\/\"\%Y`); chomp($reciept="email\@help.com"); print "-----------------$cur_date------------------------\n"; print "--------------Process ID $$----------------------\n\n\n"; system("/opt/openv/netbackup/bin/admincmd/bpdbjobs -report -format_fil +e /var/tmp/.xbpmonrc > /tmp/jobs"); while(<TEST>){ chop($_); print "-----------------$_---------------------\n"; chomp($_); $err=`cat /tmp/jobs | grep $_ | grep -i done | grep $cur_date +| awk \'\$4\!=0\' | wc -l`; print " $_ Number of errors: $err \n"; $act=`cat /tmp/jobs | grep $_ | grep -i active | grep $cur_date | +wc -l`; print " $_ Number of Active Jobs: $act \n"; $total=`cat /tmp/jobs | grep $_ | grep $cur_date | wc -l`; print " $_ Number of Jobs Done Today: $total \n"; print "\n"; } print "*************************************************************** +*****************\n"; print "Please ignore excessive errors on sapr0007 or sapr0008. Due to + these being in a\n"; print "clustered configuration, the inactive node will have multiple b +ackup errors\n "; print "*************************************************************** +*****************\n"; close(TEST); close(LOGFILE); select($old_fh); print "\nScript finished $cur_date\n\n"; system("/usr/ucb/mail -s \".::Backup Report::.\" $reciept < /tmp/log_b +ackup.txt"); system("/usr/ucb/mail -s \"----Logs----\" $reciept < /usr/emcbcv/rpr/l +ogs/backup_bcv_\`date +\%Y\%b\%d\`.log");

In reply to netbackup alert by Kri

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.