commit 747cc68754936a7609a1a6d4b44c4515d39127d8 Author: Steve Howes Date: Thu Apr 5 09:41:09 2018 +0100 first commit diff --git a/Cobalt-CheckCODB.pl b/Cobalt-CheckCODB.pl new file mode 100755 index 0000000..d65eabc --- /dev/null +++ b/Cobalt-CheckCODB.pl @@ -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; diff --git a/README.md b/README.md new file mode 100644 index 0000000..16230a9 --- /dev/null +++ b/README.md @@ -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)