Changeset 23696
- Timestamp:
- Apr 3, 2009, 9:38:20 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/bin/neb-replicate (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-replicate
r18390 r23696 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.
