5 mogfileinfo -- Fetch key metadata from a MogileFS installation
9 $ mogfileinfo --trackers=host --domain=foo --key="/hello.jpg"
15 =item --trackers=host1:7001,host2:7001
17 Use these MogileFS trackers to negotiate with.
19 =item --domain=<domain>
21 Set the MogileFS domain to use.
25 The key to inspect. Can be an arbitrary string.
31 Dormando E<lt>L<dormando@rydia.net>E<gt>
35 None known, but output might change in the future.
39 Licensed for use and redistribution under the same terms as Perl itself.
49 my $util = MogileFS
::Utils
->new;
50 my $usage = "--trackers=host --domain=foo --key='/hello.jpg'";
51 my $c = $util->getopts($usage, 'key=s');
53 my $mogc = $util->client;
55 my $fid = $mogc->file_info($c->{key
});
57 die "Error fetching file info: " . $mogc->errstr;
59 die "Key not found: " . $c->{key
} unless $fid;
61 # Might replace this with just fetching the devids from above...
62 my @paths = $mogc->get_paths($c->{key
}, { noverify
=> 1, pathcount
=> 99 });
64 die "Error fetching paths: " . $mogc->errstr;
66 die "No paths found or key does not exist" unless @paths;
68 print "- file: ", $c->{key
}, "\n";
69 for my $item (sort keys %$fid) {
70 printf(" %8s: %20s\n", $item, $fid->{$item});
73 for my $path (@paths) {
74 print " - ", $path, "\n";