This script will ultimately return the values of the regex strings for successful backup. I am stumped right now as how to proceed, as the script seems to run without error, yet return nothing.
====== Log File ===== 172.16.54.132 ssjobhnd Thu Jun 27 02:00:01 2002 SNBJH_3075J Syncsort Backup Express version 2.1.3; Copyright Syncsort Incorporated, 1996-2001 172.16.54.132 ssjobhnd Thu Jun 27 02:00:01 2002 SNBJH_3203J ===== New Job SAN03 (job ID 1025168400) (job type backup_difr) starts ===== 172.16.54.132 ssjobhnd Thu Jun 27 02:00:01 2002 SNBJH_3498J Job options: NET_COMP N; DATACOMP N; ENCRYPT N; MAXTASKS 1; MAXDRIVE 1; SKIPNFS Y; TWIN N; TWIN_OFF N; ORIG_OFF Y; RETENTION 14; TAPEWAIT 60; MNTRETRY 10; LABEL_T N; EOJ_ACT U; CHECKSUM N; VERIFY 2; F_RETRY 1; TSKRETRY 1; APPEND N; CAT_FILE N; MULTTHRD N; MULTFS N; SPLIT_SZ 0; MAILADDR DEFAULT; SQLCKDB Y; CAT_EOJ Y; FINISHFB Y; ASYNCSND N; NO_CLEAN N; CANCL_KP N; BK_MNTPT N; BK_RSM N; BK_SPF Y; 172.16.54.132 ssjobhnd Thu Jun 27 02:00:01 2002 SNBJH_3497I Job preferences: VERIFY 2; DATACOMP N; ENCRYPT N; SKIPNFS Y; F_RETRY 1; TSKRETRY 1; CAT_FILE N; MAILADDR [EMAIL PROTECTED]; SQLCKDB Y; APPEND N; LABEL_T N; RETENT_D 14; CHECKSUM N; ORIG_OFF N; TWIN N; TWIN_OFF N; EOJ_ACT U; MULTITHREAD N; MULTFS N; MAXTASKS 1; MAXDRIVE 1; MNTRETRY 10; TAPEWAIT 60; CAT_EOJ Y; FINISHFB Y; ASYNCSND N; NO_CLEAN N; CANCL_KP N; BK_MNTPT N; BK_RSM N; BK_SPF Y; 172.16.54.132 ssjobhnd Thu Jun 27 02:00:02 2002 SNBJH_3462J --- Building file list for node SEA-WEBSQL1 disk WIN2KSYS: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:03 2002 SNBJH_3462J --- Building file list for node TRCSQL0001 disk D: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:10 2002 SNBJH_3463J --- Finished building file list for node TRCSQL0001 disk D: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:10 2002 SNBJH_3477J --- No data selected under node TRCSQL0001 disk D:. Skipping. --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:10 2002 SNBJH_3462J --- Building file list for node TRCSQL0001 disk G: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:11 2002 SNBJH_3463J --- Finished building file list for node TRCSQL0001 disk G: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:00:17 2002 SNBJH_3257J ----- Task 1 (node TRCSQL0001, disk G:) of job 1025168400 starts ----- 172.16.54.111 sstptmm Thu Jun 27 02:12:02 2002 SNBTMM5462O Attempting mount for node(trcsql0001) drive(\\.\tape0) volser(SBA046) 172.16.54.132 ssjobhnd Thu Jun 27 02:01:35 2002 SNBJH_3463J --- Finished building file list for node SEA-WEBSQL1 disk WIN2KSYS: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:01:35 2002 SNBJH_3462J --- Building file list for node SEA-WEBSQL1 disk G: of job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 02:01:38 2002 SNBJH_3463J --- Finished building file list for node SEA-WEBSQL1 disk G: of job 1025168400 --- 172.16.54.111 sstptmm Thu Jun 27 02:15:04 2002 SNBTMM5467E Non-Labelled tape in drive (\\.\tape0) in jukebox ESL9198 (d:\backex\bin\jb\esl9198) 172.16.54.111 sstptmm Thu Jun 27 02:15:04 2002 SNBTMM5464E Jukebox state is not synchronized with database. Please run jukebox scan. 172.16.54.111 sstptmm Thu Jun 27 02:15:04 2002 SNBTMM5470E Volser (SBA046) moved from slot (74) has label (Non-Labelled) -- with wrong label or in wrong slot. Attempting to return to slot. 172.16.54.111 sstptmm Thu Jun 27 02:15:42 2002 SNBTMM5461O Node(trcsql0001) drive(\\.\tape0) volser(SBA046) partition(1) mount rc=(1119) 172.16.54.111 ssevthnd Thu Jun 27 02:15:42 2002 SNBEHT4351E 408: Attempted to mount tape SBA046 from slot 74 to drive Drive0_004 (node trcsql0001) but tape in that slot was unlabeled. 172.16.54.111 ssevthnd Thu Jun 27 02:15:42 2002 SNBEHT4350E 408: Please run a scan on jukebox ESL9198 172.16.54.111 ssevthnd Thu Jun 27 02:15:42 2002 SNBEHT4355E 408: Leaving volser SBA046 marked in-use or in-mount so that it will not be reused until all active jobs are done. 172.16.54.111 ssevthnd Thu Jun 27 02:15:42 2002 SNBEHT4304O 408: Retrying mount for node(trcsql0001) drive(\\.\tape0) volser(SBA269) 172.16.54.111 sstptmm Thu Jun 27 02:15:42 2002 SNBTMM5462O Attempting mount for node(trcsql0001) drive(\\.\tape0) volser(SBA269) 172.16.54.111 sstptmm Thu Jun 27 02:18:47 2002 SNBTMM5461O Node(trcsql0001) drive(\\.\tape0) volser(SBA269) partition(1) mount rc=(0) 172.16.54.132 ssjobhnd Thu Jun 27 02:20:23 2002 SNBJH_3260J ----- Done task 1 of job 1025168400 ----- 172.16.54.132 ssjobhnd Thu Jun 27 02:20:23 2002 SNBJH_3710J Task 1: KB transferred 6027937.4 Task time 800 s. Throughput 7534.9 KB/s 172.16.54.132 ssjobhnd Thu Jun 27 02:20:23 2002 SNBJH_3257J ----- Task 2 (node SEA-WEBSQL1, disk WIN2KSYS:) of job 1025168400 starts ----- 172.16.54.111 ssdmtape Thu Jun 27 02:32:13 2002 SNBDBR0494I 401: dm_get_keyword: Possible EOF on socket 5. 172.16.54.132 ssjobhnd Thu Jun 27 02:21:45 2002 SNBJH_3260J ----- Done task 2 of job 1025168400 ----- 172.16.54.132 ssjobhnd Thu Jun 27 02:21:45 2002 SNBJH_3710J Task 2: KB transferred 298959.8 Task time 82 s. Throughput 3645.9 KB/s 172.16.54.132 ssjobhnd Thu Jun 27 02:21:45 2002 SNBJH_3257J ----- Task 3 (node TRCSQL0001, disk REGISTRY:) of job 1025168400 starts ----- 172.16.54.111 ssdmtape Thu Jun 27 02:33:34 2002 SNBREG3068W 414: Skipping user NT AUTHORITY\SYSTEM because the hive file C:\WINNT\Profiles\SYSTEM.001\NTUSER.DAT could not be found. 172.16.54.111 ssdmtape Thu Jun 27 02:33:35 2002 SNBDBR0494I 401: dm_get_keyword: Possible EOF on socket 6. 172.16.54.132 ssjobhnd Thu Jun 27 02:21:59 2002 SNBJH_3260J ----- Done task 3 of job 1025168400 ----- 172.16.54.132 ssjobhnd Thu Jun 27 02:21:59 2002 SNBJH_3710J Task 3: KB transferred 11499.9 Task time 14 s. Throughput 821.4 KB/s 172.16.54.132 ssjobhnd Thu Jun 27 02:22:00 2002 SNBJH_3295J ----- Task 4 (node SEA-WEBSQL1, disk G: volume \\?\Volume{65bedb8f-7fc2-11d5-bc24-0090277a8169}\ ) of job 1025168400 starts ----- 172.16.54.111 ssdmtape Thu Jun 27 02:33:50 2002 SNBDBR0494I 401: dm_get_keyword: Possible EOF on socket 5. 172.16.54.132 ssjobhnd Thu Jun 27 02:52:08 2002 SNBJH_3260J ----- Done task 4 of job 1025168400 ----- 172.16.54.132 ssjobhnd Thu Jun 27 02:52:08 2002 SNBJH_3710J Task 4: KB transferred 11442805.1 Task time 1808 s. Throughput 6329.0 KB/s 172.16.54.132 ssjobhnd Thu Jun 27 02:52:11 2002 SNBJH_3468J --- Starting verify for device Drive0_004 in job 1025168400 --- 172.16.54.111 sstptmm Thu Jun 27 03:05:15 2002 SNBTMM5471I Node(trcsql0001) drive(\\.\tape0) volser(SBA269) partition(1) position rc=(0) 172.16.54.111 ssdmtape Thu Jun 27 03:52:07 2002 SNBDBR0494I 401: dm_get_keyword: Possible EOF on socket 6. 172.16.54.132 ssjobhnd Thu Jun 27 03:40:22 2002 SNBJH_3469J --- Finished verify for device Drive0_004 in job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 03:40:22 2002 SNBJH_3259J ===== Done tape [SBA269] of job 1025168400: 575100 blocks [18844876800 bytes] rc=0 (no error) ===== 172.16.54.111 ssdmtape Thu Jun 27 03:52:08 2002 SNBDBR0494I 401: dm_get_keyword: Possible EOF on socket 4. 172.16.54.132 ssjobhnd Thu Jun 27 03:40:22 2002 SNBJH_3269J --- Cataloging job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 03:40:23 2002 SNBJH_3527J --- Finished cataloging job 1025168400 --- 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3211J ===== Done Job 1025168400 (run time 6021 sec) [total 18207951179 bytes] ===== 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3300J ---------------------------------------- 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3301J Job Report for job SAN03 (job ID 1025168400): 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3302J Tasks completed: 4 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3304J Files backed up: 2162 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3311J Total data backed up: 17781202 KB 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3313J Total data on tape: 18403200 KB 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3308J Task 1 (node TRCSQL0001 disk G:) completed. 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3320J Volser SBA269 Partition 1 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3304J Files backed up: 3 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3308J Task 2 (node SEA-WEBSQL1 disk WIN2KSYS:) completed. 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3320J Volser SBA269 Partition 1 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3304J Files backed up: 2049 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3308J Task 3 (node TRCSQL0001 disk REGISTRY:) completed. 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3320J Volser SBA269 Partition 1 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3304J Files backed up: 1 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3308J Task 4 (node SEA-WEBSQL1 disk G:) completed. 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3320J Volser SBA269 Partition 1 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3304J Files backed up: 109 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3330J Volsers used: 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3332J SBA269 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3300J ---------------------------------------- 172.16.54.132 ssjobhnd Thu Jun 27 03:42:17 2002 SNBJH_3499I Job complete: job 1025168400 status 0 ==== End Log File==== === Begin Script ===== # ====================================================================== # # Perl Source File -- Created with SAPIEN Technologies PrimalSCRIPT(TM) # # NAME: jobreport # # AUTHOR: Mike Singleton , Davita Inc # DATE : 7/3/2002 # # PURPOSE: SyncSort Reporting # # ====================================================================== ########################################################################### # # my $HELP=" <description>: This script must be run on the Backup Express master server. This script must be run from the bin subdirectory of Backup Express if the environment variable SSPRODIR is not set to the Backup Express directory. You must have admin priviliges to run this script. \"jobrpt\" will generate a report of completed and failed Backup Express jobs, based on the information in the logs subdirectory. Note that this is not identical to the information contained in the Backup Express catalog. In particular, it only provides information on the last 30 days worth of jobs. <options>: -h : Help. USAGE; \"$0 \" Type \"$0 -h\" for help "; # <dependencies>: # None. # # <outputs>: # This script uses a temporary file $SSPRODIR/bin/jobrpt.tmp # The report is written to standard output ########################################################################### # Initialization ########################################################################### # load modules use strict; use English; use Getopt::Std; use Cwd; # Set defaults #my $CUR_DIR=cwd; #my $SSPRODIR=$ENV{SSPRODIR}; # Check for $SSPRODIR. #if ("$SSPRODIR" eq "") { # if (! -x "$CUR_DIR\/ssbrowse") { # die "$0: ERRPR: You must either set SSPRODIR or run this script from Backup Express bin directory.\n\n$HELP"; # } # chdir '..'; # $SSPRODIR=cwd; # chdir $CUR_DIR; #} #my $RPTFILE="$SSPRODIR/bin/jobrpt.tmp"; my $RPTFILE="jobrpt.tmp"; ########################################################################### # Parse arguments ########################################################################### getopts('hn:p:o:s:') or die "$HELP"; #($Getopt::Std::opt_h) and die $HELP; my $JOB_NAME=""; if (@ARGV) { $JOB_NAME=shift @ARGV; } (@ARGV==0) or die "$0: ERROR: Too many arguments on the command line."; # Get a temporary file id my $COUNT=0; #my $OUT_TEMP="$SSPRODIR/jobrpt.$COUNT"; my $OUT_TEMP="jobrpt.$COUNT"; my ($njob, @line, $current); my (@jobid, %starttime, %jobname, %jobtype, %status, %endtime, %xfer, %xfer1,%xferfiles,%volser, ); my $grepexpr; format = @<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<< $jobname{$_}, $jobtype{$_}, $starttime{$_}, $endtime{$_}, $xfer{$_},$xfer1{$_}, $volser{$_}, . #grep all the job logs for the following codes: # Job start my $JOBSTART = 'SNBJH_3203J'; # Condense start my $CONDSTART = 'SNBJH_3403'; # Job end my $JOBEND = 'SNBJH_3211J'; # Condense end my $CONDEND = 'SNBJH_3401J'; # Job cancelled my $JOBCANC = 'SNBJH_3258J'; # Job fail my $JOBFAIL = '-1'; # Volsers used my $VOLUSED = 'SNBJH_3320J'; # Transfer stats my $XFER1 = 'SNBJH_3710J'; my $XFER = 'SNBJH_3308J'; # Xfer File stats my $XFERFILES = 'SNBJH_3304J'; my %statcode = ( "$JOBEND" => '0', "$CONDEND" => '0', "$JOBFAIL" => '-1', "$JOBCANC" => '-2', ); my $MAXVLENGTH = 60; my $search; while (-f $OUT_TEMP) { $COUNT += 1; #$OUT_TEMP="$SSPRODIR/jobrpt.$COUNT"; $OUT_TEMP="jobrpt.$COUNT"; } # Open the temp file for write # Check to make sure that job exists open (OUTF,">$OUT_TEMP") || die "Cannot open output file $!"; #$grepexpr = "egrep \"$JOBSTART\|$CONDSTART\|$JOBEND\|$CONDEND\|$JOBCANC\|$VOLUSED\" \` ls -tr ../logs/3*.log\` >$OUT_TEMP"; #system "$grepexpr"; #my $files = `ls -t 3*.log`; #print $files; #$grepexpr = "grep32 \"$JOBSTART\|$CONDSTART\|$JOBEND\|$CONDEND\|$JOBCANC\|$VOLUSED\" $files>$OUT_TEMP"; #system "$grepexpr"; #print $OUT_TEMP; my @files = glob('3*.log'); $grepexpr = "egrep \"$JOBSTART\|$CONDSTART\|$JOBEND\|$CONDEND\|$JOBCANC\|$XFER\|$XFER1\|$XFERFI LES\|$VOLUSED\" @files>$OUT_TEMP"; system "$grepexpr"; print $OUT_TEMP; close OUTF; $njob = 0; # Open the temp file for read open (OUTF,"$OUT_TEMP") || die "Cannot open file for read, $!"; while (<OUTF>) { @line = split(' '); # First the grep for the start of the job print "Seventh token is $line[7]\n"; $search = '$line[7] =~ /' . "$JOBSTART" . '/'; if (eval $search) { chop $line[14]; # Remove the ")" $current = $line[14]; $jobid[$njob++] = $current; $starttime{$current} = $line[2] . " "; $starttime{$current} .= $line[3] . " "; $starttime{$current} .= $line[4] . " "; $starttime{$current} .= $line[5] . " "; $starttime{$current} .= $line[6]; $jobname{$current} = $line[11]; $jobtype{$current} = $line[17]; chop $jobtype{$current}; $status{$current} = $statcode{$JOBFAIL}; # Default $endtime{$current} .= $starttime{$current}; # Default $volser{$current} = ''; } $search = '$line[7] =~ /' . "$CONDSTART" . '/'; if (eval $search) { chop $line[15]; # Remove the ")" $current = $line[15]; $jobid[$njob++] = $current; $starttime{$current} = $line[2] . " "; $starttime{$current} .= $line[3] . " "; $starttime{$current} .= $line[4] . " "; $starttime{$current} .= $line[5] . " "; $starttime{$current} .= $line[6]; $jobname{$current} = $line[10]; $jobtype{$current} = $line[10]; $status{$current} = $statcode{$JOBFAIL}; # Default $endtime{$current} .= $starttime{$current}; # Default $volser{$current} = ''; # No volsers for Condense } $search = '$line[7] =~ /' . "$JOBEND" . '/'; if (eval $search) { # First check whether the bytecount is nonzero if ($line[17] ne '0') { $status{$current} = $statcode{$JOBEND}; } else { $status{$current} = $statcode{$JOBFAIL}; }; $endtime{$current} = $line[2] . " "; $endtime{$current} .= $line[3] . " "; $endtime{$current} .= $line[4] . " "; $endtime{$current} .= $line[5] . " "; $endtime{$current} .= $line[6]; } $search = '$line[7] =~ /' . "$CONDEND" . '/'; if (eval $search) { $status{$current} = $statcode{$CONDEND}; } $search = '$line[7] =~ /' . "$JOBCANC" . '/'; if (eval $search) { $status{$current} = $statcode{$JOBCANC}; } $search = '$line[7] =~ /' . "$XFER" . '/'; if (eval $search) { # print "Line contains token 7 $line[7].\n"; $search = '$xfer{$current} =~ /' . "$line[9]" . '/'; if (!(eval $search)) { $xfer{$current} .= ' ' . $line[9] . '(' . $line[11] . ')'; } } $search = '$line[7] =~ /' . "$XFER1" . '/'; if (eval $search) { # print "Line contains token 7 $line[7].\n"; $search = '$xfer1{$current} =~ /' . "$line[9]" . '/'; if (!(eval $search)) { $xfer1{$current} .= ' ' . $line[21] . '(' . $line[11] . ')'; } } $search = '$line[7] =~ /' . "$VOLUSED" . '/'; if (eval $search) { # print "Line contains token 7 $line[7].\n"; $search = '$volser{$current} =~ /' . "$line[9]" . '/'; if (!(eval $search)) { $volser{$current} .= ' ' . $line[9] . '(' . $line[11] . ')'; } } # Now print out the hashed data print " * * * * * "; print "Completed jobs"; print " * * * * * \n"; print "Jobname Type Start End Transfer Volsers(Partitions)\n"; foreach (@jobid) { if ($status{$_} eq $statcode{$JOBEND}) { if (length $volser{$_} > $MAXVLENGTH) { $volser{$_} = 'See job log'; } write; }; } print "\n\n * * * * * "; print "Cancelled jobs"; print " * * * * * \n"; print "Jobname Type Start End\n"; foreach (@jobid) { if ($status{$_} eq $statcode{$JOBCANC}) { write; }; } print "\n\n * * * * * "; print "Failed jobs"; print " * * * * * \n"; print "Jobname Type Start End\n"; foreach (@jobid) { if ($status{$_} eq $statcode{$JOBFAIL}) { write; }; } exit 0; } ===== End Script === -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]