Changeset 25027 for branches/pap/Nebulous/bin
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 9 edited
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous/bin (modified) (1 prop)
-
Nebulous/bin/neb-cull (modified) (6 diffs)
-
Nebulous/bin/neb-locate (modified) (2 diffs)
-
Nebulous/bin/neb-ls (modified) (1 diff)
-
Nebulous/bin/neb-replicate (modified) (1 diff)
-
Nebulous/bin/neb-rm (modified) (4 diffs)
-
Nebulous/bin/neb-stat (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/Nebulous
- Property svn:mergeinfo deleted
-
branches/pap/Nebulous/bin
- Property svn:mergeinfo changed
-
branches/pap/Nebulous/bin/neb-cull
r16183 r25027 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 -
branches/pap/Nebulous/bin/neb-locate
r16179 r25027 41 41 unless defined $neb; 42 42 43 $volume = 'any' if defined $all; 44 43 45 my $uris; 44 46 if (defined $volume) { … … 70 72 } 71 73 72 print join(" ", @files), "\n";74 print join("\n", @files), "\n"; 73 75 74 76 __END__ -
branches/pap/Nebulous/bin/neb-ls
r23934 r25027 21 21 22 22 $server = $ENV{'NEB_SERVER'} unless $server; 23 24 # make --long the default 25 $long = 1; 23 26 24 27 GetOptions( -
branches/pap/Nebulous/bin/neb-replicate
r23696 r25027 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server, $volume, $copies );18 my ($server, $volume, $copies, $set_copies); 19 19 $copies = 1; # default to making just one copy 20 20 -
branches/pap/Nebulous/bin/neb-rm
r13074 r25027 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server); 18 my ( 19 $force, 20 $move, 21 $server, 22 ); 19 23 20 24 $server = $ENV{'NEB_SERVER'} unless $server; 21 25 22 26 GetOptions( 27 'force|f' => \$force, 28 'move|m' => \$move, 23 29 'server|s=s' => \$server, 24 30 ) || pod2usage( 2 ); … … 35 41 36 42 foreach my $key (@ARGV) { 37 $neb->delete($key) or warn "failed to delete key: $key"; 43 unless (defined $move) { 44 $neb->delete($key, $force) or warn "failed to delete key: $key"; 45 } else { 46 $neb->move($key, "${key}.rm") or warn "failed to move key: $key"; 47 } 38 48 } 39 49 … … 48 58 =head1 SYNOPSIS 49 59 50 neb-rm [--server <URL>] <key...>60 neb-rm [--server <URL>] [--force] [--move] <key...> 51 61 52 62 =head1 DESCRIPTION … … 58 68 59 69 =over 4 70 71 =item * --force|-f 72 73 When set, C<<key>> will be removed from the nebulous database even if the on 74 disk file(s) are missing. 75 76 Optional. 77 78 =item * --move|-m 79 80 When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of 81 being deleted. 82 83 Optional. 60 84 61 85 =item * --server|-s <URL> -
branches/pap/Nebulous/bin/neb-stat
r18016 r25027 41 41 my $stat = $neb->stat($key); 42 42 die "nebulous key: $key not found" unless $stat; 43 my $instances = $neb->find_instances($key, ' :any');43 my $instances = $neb->find_instances($key, 'any'); 44 44 die "no instances found" unless $instances; 45 45 46 46 no warnings qw(uninitialized); 47 47 print 48 "object id: ", @$stat[0], "\n", 49 "key: ", @$stat[1], "\n", 50 "read lock: ", @$stat[2], "\n", 51 "write lock: ", @$stat[3], "\n", 52 "epoch: ", @$stat[4], "\n", 53 "mtime: ", @$stat[5], "\n", 54 "n instances: ", @$stat[6], "\n", 48 "object id: ", @$stat[0], "\n", 49 "key: ", @$stat[1], "\n", 50 "read lock: ", @$stat[2], "\n", 51 "write lock: ", @$stat[3], "\n", 52 "epoch: ", @$stat[4], "\n", 53 "mtime: ", @$stat[5], "\n", 54 "available instances: ", @$stat[6], "\n", 55 "total instances: ", @$stat[7], "\n", 55 56 "instance location:\n", " " x 4, 56 57 join("\n" . " " x 4, @$instances), "\n";
Note:
See TracChangeset
for help on using the changeset viewer.
