Changeset 24244 for branches/cnb_branches/cnb_branch_20090301/Nebulous/bin
- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous/bin (modified) (1 prop)
-
Nebulous/bin/neb-ls (modified) (7 diffs)
-
Nebulous/bin/neb-replicate (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/Nebulous
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/pap/Nebulous merged eligible /trunk/Nebulous merged eligible /branches/eam_branches/eam_branch_20090303/Nebulous 23158-23228 /branches/jhoblitt/Nebulous 2785-12604 /branches/pap_magic/Nebulous 24120-24173
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/Nebulous/bin
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/neb_distrib_20081210/Nebulous/bin merged eligible /branches/pap/Nebulous/bin merged eligible /trunk/Nebulous/bin merged eligible /branches/eam_branches/eam_branch_20090303/Nebulous/bin 23158-23228 /branches/jhoblitt/Nebulous/bin 2785-12604 /branches/pap_magic/Nebulous/bin 24120-24173
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/Nebulous/bin/neb-ls
r18092 r24244 1 1 #!/usr/bin/env perl 2 2 3 # Copyright (C) 2007-2008 Joshua Hoblitt 4 # 5 # $Id: neb-ls,v 1.7 2008-06-12 20:03:37 jhoblitt Exp $ 3 # Copyright (C) 2007-2009 Joshua Hoblitt 6 4 7 5 use strict; … … 9 7 10 8 use vars qw( $VERSION ); 11 $VERSION = '0.0 2';9 $VERSION = '0.03'; 12 10 13 11 use Nebulous::Client; … … 16 14 use Pod::Usage qw( pod2usage ); 17 15 18 my ($server, $long, $recursive); 16 my ( 17 $server, 18 $long, 19 # $recursive, 20 ); 19 21 20 22 $server = $ENV{'NEB_SERVER'} unless $server; … … 22 24 GetOptions( 23 25 'server|s=s' => \$server, 24 'recursive|r' => \$recursive,26 # 'recursive|r' => \$recursive, 25 27 'l|1' => \$long, 26 28 ) || pod2usage( 2 ); … … 39 41 unless defined $neb; 40 42 41 # default to listing everything (bad idea?)42 $pattern ||= " .*";43 # default to listing root 44 $pattern ||= "/"; 43 45 44 if ($recursive) {45 $pattern = "^" . $pattern . ".*";46 } else {47 $pattern = "^" . $pattern . "\$";48 }46 #if ($recursive) { 47 # $pattern = "^" . $pattern . ".*"; 48 #} else { 49 # $pattern = "^" . $pattern . "\$"; 50 #} 49 51 50 52 my $keys = $neb->find_objects($pattern); … … 86 88 Optional 87 89 88 =item * --recursive|-r 89 90 By default C<neb-ls> will only try to match the exact string provided to it. 91 With this option set all keys which match C<<pattern>> as a REGEX or substring 92 will be returned. 93 94 Optional 95 90 =cut 91 #=item * --recursive|-r 92 # 93 #By default C<neb-ls> will only try to match the exact string provided to it. 94 #With this option set all keys which match C<<pattern>> as a REGEX or substring 95 #will be returned. 96 # 97 #Optional 98 # 96 99 =item * --server|-s <URL> 97 100 … … 130 133 =head1 COPYRIGHT 131 134 132 Copyright (C) 2007-200 8Joshua Hoblitt. All rights reserved.135 Copyright (C) 2007-2009 Joshua Hoblitt. All rights reserved. 133 136 134 137 This program is free software; you can redistribute it and/or modify it under -
branches/cnb_branches/cnb_branch_20090301/Nebulous/bin/neb-replicate
r18390 r24244 25 25 'volume|v=s' => \$volume, 26 26 'copies|c=i' => \$copies, 27 'set_copies=i' => \$set_copies, 27 28 ) || pod2usage( 2 ); 28 29 … … 44 45 unless defined $neb; 45 46 46 for (my $i = 0; $i < $copies; $i++) { 47 if (defined $volume) { 48 $neb->replicate($key, $volume) 49 or die "failed to replicate Nebulous key: $key"; 50 } else { 51 $neb->replicate($key) 52 or die "failed to replicate Nebulous key: $key"; 47 # if replicate fails, we should still set user.copies (if requested) 48 my $replication_problem; 49 eval { 50 for (my $i = 0; $i < $copies; $i++) { 51 if (defined $volume) { 52 $neb->replicate($key, $volume) 53 or die "failed to replicate Nebulous key: $key"; 54 } else { 55 $neb->replicate($key) 56 or die "failed to replicate Nebulous key: $key"; 57 } 53 58 } 59 }; 60 if ($@) { 61 warn $@; 62 $replication_problem = 1; 54 63 } 55 64 65 if ($set_copies) { 66 $neb->setxattr($key, "user.copies", $copies, "replace") 67 or die $neb->err; 68 } 69 70 exit(32) if defined $replication_problem; 56 71 57 72 __END__ … … 66 81 67 82 neb-replicate [--server <URL>] [--volume <volume name>] 68 [--copies <n>] <key>83 [--copies <n>] [--set_copies <n>] <key> 69 84 70 85 =head1 DESCRIPTION … … 93 108 The number of new replications to create. 94 109 95 Optional. Defaults to 0. 110 Optional. Defaults to 1. 111 112 =item * --set_copies|c <n> 113 114 Set the C<user.copies> xattr for this storage object to C<<n>>. 115 116 Optional. 96 117 97 118 =back
Note:
See TracChangeset
for help on using the changeset viewer.
