Changeset 41054
- Timestamp:
- Nov 5, 2019, 8:10:42 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20191011/Nebulous/bin/neb-stat
r40994 r41054 19 19 use URI; 20 20 21 my ($validate,$server,$nouris );21 my ($validate,$server,$nouris,$help); 22 22 23 23 $server = $ENV{'NEB_SERVER'} unless $server; 24 24 25 25 GetOptions( 26 'server|s=s' => \$server, 27 'validate|v' => \$validate, 28 'files' => \$nouris, 26 'server|s=s' => \$server, 27 'validate|v' => \$validate, 28 'files|f' => \$nouris, 29 'help|h' => \$help, 29 30 ) || pod2usage( 2 ); 30 31 32 # explicitly defined -h / --help: 33 if ($help) { pod2usage( -verbose => 1 ); } 34 31 35 my $key = shift; 32 36 33 37 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 34 pod2usage( -msg => "Required options: --server", -exitval => 2 ) 35 unless $server; 36 pod2usage( -msg => "missing key", exitval => 2 ) 37 unless defined $key; 38 pod2usage( -msg => "Required options: --server", -exitval => 2 ) unless $server; 39 pod2usage( -msg => "missing key", exitval => 2 ) unless defined $key; 38 40 39 41 my $neb = Nebulous::Client->new( … … 75 77 $md5sum_uniq{$md5sums[$i]} = 1; 76 78 close($fh); 77 } 78 else { 79 } else { 79 80 $existance[$i] = 0; 80 81 $md5sums[$i] = 'NON-EXISTANT'; 81 82 $md5sum_uniq{$md5sums[$i]} = 1; 82 83 } 84 83 85 if (defined($nouris)) { 84 86 $validation[$i] = sprintf("% 3d %32s %s", … … 86 88 $md5sums[$i], 87 89 $files[$i]); 88 } 89 else { 90 } else { 90 91 $validation[$i] = sprintf("% 3d %32s %s", 91 92 $existance[$i], … … 113 114 "instance location:\n", " " x 4, 114 115 join("\n" . " " x 4, @validation), "\n"; 116 } else { 117 118 if (defined($nouris)) { 119 my @files = map {URI->new($_)->file if $_} @$instances; 120 121 print 122 "object id: ", @$stat[0], "\n", 123 "key: ", @$stat[1], "\n", 124 "read lock: ", @$stat[2], "\n", 125 "write lock: ", @$stat[3], "\n", 126 "epoch: ", @$stat[4], "\n", 127 "mtime: ", @$stat[5], "\n", 128 "available instances: ", @$stat[6], "\n", 129 "requested instances: ", $user_copies, "\n", 130 "total instances: ", @$stat[7], "\n", 131 132 "instance location:\n", " " x 4, 133 join("\n" . " " x 4, @files), "\n"; 134 } else { 135 print 136 "object id: ", @$stat[0], "\n", 137 "key: ", @$stat[1], "\n", 138 "read lock: ", @$stat[2], "\n", 139 "write lock: ", @$stat[3], "\n", 140 "epoch: ", @$stat[4], "\n", 141 "mtime: ", @$stat[5], "\n", 142 "available instances: ", @$stat[6], "\n", 143 "requested instances: ", $user_copies, "\n", 144 "total instances: ", @$stat[7], "\n", 145 146 "instance location:\n", " " x 4, 147 join("\n" . " " x 4, @$instances), "\n"; 148 } 149 115 150 } 116 else {117 print118 "object id: ", @$stat[0], "\n",119 "key: ", @$stat[1], "\n",120 "read lock: ", @$stat[2], "\n",121 "write lock: ", @$stat[3], "\n",122 "epoch: ", @$stat[4], "\n",123 "mtime: ", @$stat[5], "\n",124 "available instances: ", @$stat[6], "\n",125 "requested instances: ", $user_copies, "\n",126 "total instances: ", @$stat[7], "\n",127 128 "instance location:\n", " " x 4,129 join("\n" . " " x 4, @$instances), "\n";130 }131 151 132 152 … … 151 171 =over 4 152 172 153 =item *--server|-s <URL>173 =item --server|-s <URL> 154 174 155 175 URL of the Nebulous server to connect to. … … 157 177 Optional if the appropriate environment variable is set. 158 178 159 =item *--validate|-v179 =item --validate|-v 160 180 161 181 Optional - prints out additional information including md5sum. 162 182 163 =item *--files183 =item --files 164 184 165 185 Optional - prints out disk files instead of uris during validate stage. … … 175 195 =over 4 176 196 177 =item *C<NEB_SERVER>197 =item C<NEB_SERVER> 178 198 179 199 Equivalent to --server|-s
Note:
See TracChangeset
for help on using the changeset viewer.
