Data Protector Support and News Forum
Showing results for 
Search instead for 
Do you mean 

How to create a list of all Medium ID´s?

SOLVED
Go to Solution
Established Member

How to create a list of all Medium ID´s?

[ Edited ]

Hello!

 

I´m searching for a command which shows me all medium id´s.

Can you help me?

 

thanks

&

regards

Dominic

1 ACCEPTED SOLUTIONS
Highlighted
Established Member

Re: How to create a list of all Medium ID´s?

[ Edited ]

Hi danielbraun,

 

thanks for the solution in perl!


I have made a script in ksh for unix:

 

#!/bin/ksh

poollist=`omnimm -list_pools | grep poolnames | awk '{print $2}'`

for i in $poollist
 do
  omnimm -list_pool $i -detail | grep identifier | awk '{print $4}'
 done

 

 

regards

Dominic

4 REPLIES
Honored Contributor

Re: How to create a list of all Medium ID´s?

Hello

 

You can do it so listing pool by pool

 

omnimm -list_pool "pool name" -detail

Established Member

Re: How to create a list of all Medium ID´s?

Oh,

 

I have many pools to search for.

About 100!

 

Now i´m using this command to get the ID from a pool:

 

omnimm -list_pool "pool name" -detail | grep identifier

 

But it would be nice when everyone knows a command that includes all pools!

Honored Contributor

Re: How to create a list of all Medium ID´s?

Hi,

 

maybe the perlscript will do the trick for you... quick and dirty, but will list you all identifiers from all pools with the poolname as headline.

 

Best regards

Daniel

 

#!perl
my $command="omnimm -list_pools -detail";
my @command=`$command 2>&1`;

foreach $command(@command)
{
 chomp $command;
 if ($command=~ /^Pool name/)
 {
  my ($dummy,$poolname)=split(/ : /,$command,2);
  $poolname=~ s/\s+$//g;
  print $poolname."\n==============================\n";
  my $command1="omnimm -list_pool \"".$poolname."\" -detail";
  my @command1=`$command1 2>&1`;
  foreach (@command1)
  {
   if ($_=~ /Medium identifier/)
   {
    my ($dummy,$identifier)=split(/ : /,$_,2);
    $identifier=~ s/\s+$//g;
    print $identifier."\n";
   }
  }
 }
}

-----------
Please assign Kudos - How to assign...
Highlighted
Established Member

Re: How to create a list of all Medium ID´s?

[ Edited ]

Hi danielbraun,

 

thanks for the solution in perl!


I have made a script in ksh for unix:

 

#!/bin/ksh

poollist=`omnimm -list_pools | grep poolnames | awk '{print $2}'`

for i in $poollist
 do
  omnimm -list_pool $i -detail | grep identifier | awk '{print $4}'
 done

 

 

regards

Dominic