first commit

This commit is contained in:
Steve Howes
2018-04-05 09:41:09 +01:00
commit 747cc68754
2 changed files with 43 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/perl
opendir(DIR, "/usr/sausalito/codb/objects");
@FILES=readdir(DIR);
@FILESSORT = sort { $a <=> $b } @FILES;
$lastvalidoid = -100;
$i=0;
$lastdash = 0;
$oidslist = "";
foreach(@FILESSORT)
{
if ($_ =~ /^-?\d/)
{
if($FILESSORT[$i+1] == $_ + 1)
{
if($lastdash == 0)
{
$oidslist .= "$_-";
}
$lastdash = 1;
}else{
$lastdash = 0;
$oidslist .= "$_,";
}
$lastvalidoid = $_;
}
$i++;
}
if(substr($oidslist, -1, 1) == ",")
{
chop($oidslist);
}
open FILE, ">myoids" or die $!;
print FILE $oidslist;
close FILE;
+7
View File
@@ -0,0 +1,7 @@
# Cobalt-CheckCODB
Used for checking consistency of th CODB database index. Corruption is common on Cobalt, BlueQuartz and early BlueOnyx.
[root@BQ ~]# perl cobalt-codbcheck.pl
[root@BQ ~]# diff myoids /usr/sausalito/codb/codb.oids
Should return nothing. If it returns something then myoids can be used in place of codb.oids to make the database consistent (but doesn't confirm any data is correct)