Changeset 25022 for branches/eam_branches/20090715/Nebulous/bin/neb-cull
- Timestamp:
- Aug 7, 2009, 12:45:24 PM (17 years ago)
- Location:
- branches/eam_branches/20090715
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Nebulous/bin/neb-cull (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715
- Property svn:mergeinfo changed
/trunk (added) merged: 24801-24824,24827-24834,24836-24859,24861-24901,24903-24912,24914-24950,24953-24971,24973-24977,24986-24989,24993-25017
- Property svn:mergeinfo changed
-
branches/eam_branches/20090715/Nebulous/bin/neb-cull
r16183 r25022 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server, $volume );18 my ($server, $volume, $one_only); 19 19 20 20 $server = $ENV{'NEB_SERVER'} unless $server; … … 23 23 'server|s=s' => \$server, 24 24 'volume|v=s' => \$volume, 25 'one_only|o' => \$one_only, 25 26 ) || pod2usage( 2 ); 26 27 … … 40 41 unless defined $neb; 41 42 43 my @cull_args; 44 push @cull_args, $key; 42 45 if (defined $volume) { 43 $neb->cull($key, $volume) 44 or die "failed to replicate Nebulous key: $key"; 46 push @cull_args, $volume; 47 } 48 49 if ($one_only) { 50 my $status = $neb->there_can_be_only_one(@cull_args); 51 if ($status == 0) { 52 die "not enough instances of Nebulous key: $key"; 53 } 54 if (not defined $status or $status < 1) { 55 die "failed to cull Nebulous key: $key - " . $neb->err 56 if defined $neb->err; 57 die "failed to cull Nebulous key: $key"; 58 } 45 59 } else { 46 $neb->cull($key) 47 or die "failed to replicate Nebulous key: $key"; 60 unless (defined $neb->cull(@cull_args)) { 61 die "failed to cull Nebulous key: $key - " . $neb->err; 62 } 48 63 } 49 64 … … 58 73 =head1 SYNOPSIS 59 74 60 neb-cull [--server <URL>] [--volume <volume name>] <key>75 neb-cull [--server <URL>] [--volume <volume name>] [--one_only] <key> 61 76 62 77 =head1 DESCRIPTION … … 77 92 78 93 Symbolic name of the volume to create the new instance on. 94 95 Optional. 96 97 =item * --one_only|-o 98 99 Removes all but one instances of an object. Any inaccessible instances are 100 removed. If C<--volume> is specified, and an instance exists on that volume, 101 all instances but the one on that volume are removed. 79 102 80 103 Optional. … … 110 133 =head1 COPYRIGHT 111 134 112 Copyright (C) 2007-200 8Joshua Hoblitt. All rights reserved.135 Copyright (C) 2007-2009 Joshua Hoblitt. All rights reserved. 113 136 114 137 This program is free software; you can redistribute it and/or modify it under
Note:
See TracChangeset
for help on using the changeset viewer.
