Changeset 17817 for trunk/Nebulous-Server
- Timestamp:
- May 27, 2008, 1:26:15 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/bin/neb-admin (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/bin/neb-admin
r17815 r17817 3 3 # Copyright (C) 2005-2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-admin,v 1. 2 2008-05-27 21:59:53jhoblitt Exp $5 # $Id: neb-admin,v 1.3 2008-05-27 23:26:15 jhoblitt Exp $ 6 6 7 7 use strict; … … 19 19 use Pod::Usage qw( pod2usage ); 20 20 21 my ($db, $dbuser, $dbpass, $ server, $limit);21 my ($db, $dbuser, $dbpass, $pending, $limit); 22 22 23 23 $db = $ENV{'NEB_DB'} unless $db; 24 24 $dbuser = $ENV{'NEB_USER'} unless $dbuser; 25 25 $dbpass = $ENV{'NEB_PASS'} unless $dbpass; 26 $server = $ENV{'NEB_SERVER'} unless $server;27 26 28 27 GetOptions( 29 'db=s' => \$db,30 'user=s' => \$dbuser,31 'pass=s' => \$dbpass,32 ' server|s=s' => \$server,33 'limit|l=i' => \$limit,28 'db=s' => \$db, 29 'user=s' => \$dbuser, 30 'pass=s' => \$dbpass, 31 'pendingreplicate|p' => \$pending, 32 'limit|l=i' => \$limit, 34 33 ) || pod2usage( 2 ); 35 34 36 35 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 37 pod2usage( -msg => "Required options: --server", -exitval => 2 )38 unless $server;39 36 pod2usage( -msg => "Required options: --db --user --pass", -exitval => 2 ) 40 37 unless $db && $dbuser && $dbpass; 38 pod2usage( -msg => "--limit is meaningless without --pendingreplicate", 39 -exitval => 2 ) 40 if defined $limit and not defined $pending; 41 pod2usage( -msg => "no operation specified", -exitval => 2 ) 42 unless defined $pending; 41 43 42 44 # set default limit to 5 43 45 $limit ||= 5; 44 45 my $neb = Nebulous::Client->new(46 proxy => "$server",47 );48 49 die "can't connected to Nebulous Server: $server"50 unless defined $neb;51 46 52 47 my $dbh = DBI->connect( … … 157 152 =head1 NAME 158 153 159 neb- fsck - check and repair Nebulous volumes154 neb-admin - perform misc. Nebulous administrative functions 160 155 161 156 =head1 SYNOPSIS 162 157 163 neb- fsck[--db <database>] [--user <username>] [--pass <password>]164 [-- server <server>]158 neb-admin [--db <database>] [--user <username>] [--pass <password>] 159 [--pendingreplicate] [--limit <n>] 165 160 166 161 =head1 DESCRIPTION … … 170 165 =over 4 171 166 172 =item * --server|-s <URL> 173 174 URL of the Nebulous server to connect to. 175 176 Optional if the appropriate environment variable is set. 167 =item * --pendingreplicate|-p 168 169 Print out a list of nebulous keys that need additional replications created. 170 171 =item * --limit|-l <n> 172 173 Limits the number of items return in response to some request (like 174 C<--pendingreplicate>). 175 176 Optional. Defaults to 5. --limit 0 is treated as asking for the default 177 value. 177 178 178 179 =item * --db|-d <database> … … 203 204 204 205 =over 4 205 206 =item * C<NEB_SERVER>207 208 Equivalent to --server|-s209 206 210 207 =item * C<NEB_DB> … … 256 253 =head1 SEE ALSO 257 254 258 L<Nebulous::Server>, L<neb- initdb>, L<neb-df>, L<nebdiskd>255 L<Nebulous::Server>, L<neb-addvol>, L<neb-fsck>, L<neb-initdb>, L<nebdiskd> 259 256 260 257 =cut
Note:
See TracChangeset
for help on using the changeset viewer.
