#
# cnid_maint: A script to maintain the consistency of CNID databases.
#
-# $Id: cnid_maint.in,v 1.4.2.2 2002-02-09 20:27:45 jmarcus Exp $
+# $Id: cnid_maint.in,v 1.4.2.3 2002-02-11 21:21:30 jmarcus Exp $
#
use strict;
$remove_logs = 1;
}
+if ( $< != 0 ) {
+ die "You must be root to run this script.\n";
+}
+
print "Beginning run of CNID DB Maintanence script at "
. scalar(localtime) . ".\n\n";
my $path = "";
foreach $path (@paths) {
my $dbpath = $path . "/.AppleDB";
+ if ( !-d $dbpath ) {
+ error( 1, "Database environment $dbpath does not exist" );
+ next;
+ }
if ($extra_safe) {
error( 0,
"Checking database environment $dbpath for open connections..." );
}
sub version {
- print "cnid_maint.pl version $VERSION\n";
+ print "$0 version $VERSION\n";
}
sub help {
- print "usage: cnid_maint.pl [-hlsvV]\n";
+ print "usage: $0 [-hlsvV]\n";
print "\t-h view this message\n";
print "\t-l remove transaction logs after running recovery\n";
print