Changeset 18349
- Timestamp:
- Jun 27, 2008, 1:29:42 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 2 edited
-
Changes (modified) (1 diff)
-
bin/neb-admin (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r18231 r18349 2 2 3 3 0.13 4 - add --host option to neb-admin 4 5 - add --host option to nebdiskd 5 6 - decalare default SQL character set -
trunk/Nebulous-Server/bin/neb-admin
r17817 r18349 3 3 # Copyright (C) 2005-2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-admin,v 1. 3 2008-05-27 23:26:15jhoblitt Exp $5 # $Id: neb-admin,v 1.4 2008-06-27 23:29:42 jhoblitt Exp $ 6 6 7 7 use strict; … … 9 9 10 10 use vars qw( $VERSION ); 11 $VERSION = '0.0 1';11 $VERSION = '0.02'; 12 12 13 13 use DBI; … … 19 19 use Pod::Usage qw( pod2usage ); 20 20 21 my ($db, $dbuser, $dbpass, $pending, $limit); 22 23 $db = $ENV{'NEB_DB'} unless $db; 24 $dbuser = $ENV{'NEB_USER'} unless $dbuser; 25 $dbpass = $ENV{'NEB_PASS'} unless $dbpass; 21 my ($db, $dbhost, $dbuser, $dbpass, $pending, $limit); 22 23 $db = $ENV{'NEB_DB'}; 24 $dbhost = $ENV{'NEB_DBHOST'} || 'localhost'; 25 $dbuser = $ENV{'NEB_USER'}; 26 $dbpass = $ENV{'NEB_PASS'}; 26 27 27 28 GetOptions( 28 'db=s' => \$db, 29 'user=s' => \$dbuser, 30 'pass=s' => \$dbpass, 31 'pendingreplicate|p' => \$pending, 29 'db|d=s' => \$db, 30 'host=s' => \$dbhost, 31 'user|u=s' => \$dbuser, 32 'pass|p=s' => \$dbpass, 33 'pendingreplicate|r' => \$pending, 32 34 'limit|l=i' => \$limit, 33 35 ) || pod2usage( 2 ); … … 46 48 47 49 my $dbh = DBI->connect( 48 "DBI:mysql:database=$db:host= localhost",50 "DBI:mysql:database=$db:host=$dbhost", 49 51 $dbuser, 50 52 $dbpass, … … 69 71 $query->finish; 70 72 73 exit unless scalar @rows; 74 71 75 print "replciate MULTI\n\n"; 72 76 … … 156 160 =head1 SYNOPSIS 157 161 158 neb-admin [-- db <database>] [--user <username>] [--pass <password>]159 [--p endingreplicate] [--limit <n>]162 neb-admin [--host <db host>] [--db <db name>] [--user <db username>] 163 [--pass <db password>] [--pendingreplicate] [--limit <n>] 160 164 161 165 =head1 DESCRIPTION … … 165 169 =over 4 166 170 167 =item * --pendingreplicate|- p171 =item * --pendingreplicate|-r 168 172 169 173 Print out a list of nebulous keys that need additional replications created. … … 176 180 Optional. Defaults to 5. --limit 0 is treated as asking for the default 177 181 value. 182 183 =item * --host <database host> 184 185 Name of host on which the database resides. 186 187 Optional. Defaults to C<localhost>. 178 188 179 189 =item * --db|-d <database> … … 208 218 209 219 Equivalent to --db|-d 220 221 =item * C<NEB_HOST> 222 223 Equivalent to --host 210 224 211 225 =item * C<NEB_USER>
Note:
See TracChangeset
for help on using the changeset viewer.
