B
Brian W
I'm trying to write a very simple script to print the output of
bpplinfo <policyname> -L
for every Netbackup Policy at once. (I'll modify it to do more later.)
#!/usr/bin/perl -w
$BPPLLIST = "/opt/openv/netbackup/bin/admincmd/bppllist";
$TEMPPOLICYFILE = "/tmp/tmppol.out";
system "$BPPLLIST > $TEMPPOLICYFILE";
open ( POLFILE , $TEMPPOLICYFILE ) || die "couldnt open tmppol.out";
while ( <POLFILE> ) {
my $BPPLINFO = (`/opt/openv/netbackup/bin/admincmd/bpplinfo $_ -L `;
push@INFO,$BPPLINFO;
}
print @INFO;
`rm /tmp/tmppol.out`;
The problem is in the
$BPPLINFO = `/opt/openv/netbackup/bin/admincmd/bpplinfo $_ -L `
Whether I do this in the backticks, or in a roundabout fashion with the
system function, the command still fails because Veritas wrote its
utilities with the bizarre requirement to put the option flag AFTER the
arguement. When I run it I see the failed output just as if I had run
from the shell:
# bpplinfo POLICYNAME ; -L
I don't understand Perl super-well, but apparently the backticks and
system function both try to execute the -L separatelly from the
bpplinfo POLICYNAME.
Can anyone help me get around this?
bpplinfo <policyname> -L
for every Netbackup Policy at once. (I'll modify it to do more later.)
#!/usr/bin/perl -w
$BPPLLIST = "/opt/openv/netbackup/bin/admincmd/bppllist";
$TEMPPOLICYFILE = "/tmp/tmppol.out";
system "$BPPLLIST > $TEMPPOLICYFILE";
open ( POLFILE , $TEMPPOLICYFILE ) || die "couldnt open tmppol.out";
while ( <POLFILE> ) {
my $BPPLINFO = (`/opt/openv/netbackup/bin/admincmd/bpplinfo $_ -L `;
push@INFO,$BPPLINFO;
}
print @INFO;
`rm /tmp/tmppol.out`;
The problem is in the
$BPPLINFO = `/opt/openv/netbackup/bin/admincmd/bpplinfo $_ -L `
Whether I do this in the backticks, or in a roundabout fashion with the
system function, the command still fails because Veritas wrote its
utilities with the bizarre requirement to put the option flag AFTER the
arguement. When I run it I see the failed output just as if I had run
from the shell:
# bpplinfo POLICYNAME ; -L
I don't understand Perl super-well, but apparently the backticks and
system function both try to execute the -L separatelly from the
bpplinfo POLICYNAME.
Can anyone help me get around this?