mirror of
https://github.com/stevenhowes/Cobalt-CheckCODB.git
synced 2026-05-26 15:53:26 +01:00
first commit
This commit is contained in:
Executable
+36
@@ -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;
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user