Changeset 23691 for branches/neb_distrib_20081210/Nebulous/bin
- Timestamp:
- Apr 2, 2009, 3:00:37 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/neb_distrib_20081210/Nebulous/bin/neb-replicate
r23568 r23691 45 45 unless defined $neb; 46 46 47 # XXX if replicate fails, we should still set user.copies (if requested) 48 for (my $i = 0; $i < $copies; $i++) { 49 if (defined $volume) { 50 $neb->replicate($key, $volume) 51 or die "failed to replicate Nebulous key: $key"; 52 } else { 53 $neb->replicate($key) 54 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 } 55 58 } 59 }; 60 if ($@) { 61 warn $@; 62 $replication_problem = 1; 56 63 } 57 64 58 if (defined $set_copies && $set_copies) { 59 write_xattrs($neb, $key, "user.copies:$set_copies") or die; 65 if ($set_copies) { 66 $neb->setxattr($key, "user.copies", $copies, "replace") 67 or die $neb->err; 60 68 } 69 70 exit(32) if defined $replication_problem; 61 71 62 72 __END__ … … 71 81 72 82 neb-replicate [--server <URL>] [--volume <volume name>] 73 [--copies <n>] <key>83 [--copies <n>] [--set_copies <n>] <key> 74 84 75 85 =head1 DESCRIPTION … … 98 108 The number of new replications to create. 99 109 100 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. 101 117 102 118 =back
Note:
See TracChangeset
for help on using the changeset viewer.
