Something like this should work as a perl script.  You'll need to install ActivePerl (http://www.activestate.com/) on your SA box.
 
SARobocopy.pl
====================
$exit = 0;
 
while (<>) {
 if ( $_ =~ /.*Dirs :\s+\d+\s+\d+\s+\d+\s+(\d+).*/ ) {
  if ( $1 ne "0" ) { $exit = 1; }
  }
 if ( $_ =~ /.*Files :\s+\d+\s+\d+\s+\d+\s+(\d+).*/ ) {
  if ( $1 ne "0" ) { $exit = 1; }
  }
 if ( $_ =~ /.*Bytes :.{34}\s+(\d+).*/ ) {
  if ( $1 ne "0" ) { $exit = 1; }
  }
 }
 
print "exit: $exit\n";
exit($exit);
=======================
 
If you call it from the command line like "SARobocopy.pl name_of_log_file.txt" it'll look for the Dirs, Files, and Bytes lines and extract the number from the FAILED column.  If any don't show zero it'll exit with an error code of 1.  Works for me with the log file you gave.  To use it from SA make sure and use the full path to the perl binary in your SA command line.  Something like this:
 
c:\perl\bin\perl.exe "c:\program files\ServersAlive\SARobocopy.pl" log_file_name.txt

Mark Bradshaw
Salem Web Network
[EMAIL PROTECTED]
9401 Courthouse Road, Suite 300
Chesterfield, VA 23832
804.768.9404 x123

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ahmed Hassan
Sent: Thursday, November 06, 2003 8:10 AM
To: [EMAIL PROTECTED]
Subject: Re: [SA-list] Ideas from Group

Thanks for the suggestion . I don't know whether you took a look at the snippet of the log file - anyway it will be difficult to just do a search on a word like "fail". Apart from that each log file is about 300 - 500Kb from each remote site. Hence, the reason for looking for way to automate the process.


Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger

Reply via email to