Changeset 27839 for branches/simmosaic_branches/Nebulous/bin/neb-cull
- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Nebulous/bin/neb-cull (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_branches/Nebulous/bin/neb-cull
r16183 r27839 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($ server, $volume);18 my ($min_copies, $server, $volume, $one_only); 19 19 20 20 $server = $ENV{'NEB_SERVER'} unless $server; 21 21 22 22 GetOptions( 23 'min_copies|m=i'=> \$min_copies, 23 24 'server|s=s' => \$server, 24 25 'volume|v=s' => \$volume, 26 'one_only|o' => \$one_only, 25 27 ) || pod2usage( 2 ); 26 28 … … 40 42 unless defined $neb; 41 43 42 if (defined $volume) { 43 $neb->cull($key, $volume) 44 or die "failed to replicate Nebulous key: $key"; 44 $volume ||= "any"; 45 $min_copies ||= 2; 46 47 my @cull_args; 48 push @cull_args, $key; 49 push @cull_args, $volume; 50 51 if ($one_only) { 52 my $status = $neb->there_can_be_only_one(@cull_args); 53 if ($status == 0) { 54 die "not enough instances of Nebulous key: $key"; 55 } 56 if (not defined $status or $status < 1) { 57 die "failed to cull Nebulous key: $key - " . $neb->err 58 if defined $neb->err; 59 die "failed to cull Nebulous key: $key"; 60 } 45 61 } else { 46 $neb->cull($key) 47 or die "failed to replicate Nebulous key: $key"; 62 push @cull_args, $min_copies; 63 unless (defined $neb->cull(@cull_args)) { 64 die "failed to cull Nebulous key: $key - " . $neb->err; 65 } 48 66 } 49 67 … … 58 76 =head1 SYNOPSIS 59 77 60 neb-cull [--server <URL>] [--volume <volume name>] <key>78 neb-cull [--server <URL>] [--volume <volume name>] [--one_only] <key> 61 79 62 80 =head1 DESCRIPTION … … 77 95 78 96 Symbolic name of the volume to create the new instance on. 97 98 Optional. 99 100 =item * --one_only|-o 101 102 Removes all but one instances of an object. Any inaccessible instances are 103 removed. If C<--volume> is specified, and an instance exists on that volume, 104 all instances but the one on that volume are removed. 79 105 80 106 Optional. … … 110 136 =head1 COPYRIGHT 111 137 112 Copyright (C) 2007-200 8Joshua Hoblitt. All rights reserved.138 Copyright (C) 2007-2009 Joshua Hoblitt. All rights reserved. 113 139 114 140 This program is free software; you can redistribute it and/or modify it under
Note:
See TracChangeset
for help on using the changeset viewer.
