mastership有两种状态:disable和enable
如何统计所有VOB的status呢?
来个小破(perl)脚本吧:
#!/usr/bin/perl
use strict;
system("cleartool lsvob > rebvoblist.txt");
my $filename = "rebvoblist.txt";
if(-e $filename)
{
open(FILE, $filename);
my @array = <FILE>;
my $vobname = "";
print "VOB_Name,MasterShip \n";
foreach(@array)
{
my $line = $_;
my $string1 = "ucmvob";
my $string2 = "replicated";
if (!/$string1/ && /$string2/)
{
$line = ~/(.*)\\\\/;
$vobname = $1;
print $vobname, ",";
system("cleartool lsreplica -l -invob $vobname | findstr \/i \"mastership:\"");
}
}
close FILE;
}
运行:
perl script.pl > 1114.csv
csv可以用xls打开,搞定。
欢迎交流!