Re: dsmc command question?
2004-10-06 15:38:43
On Wed, 06 Oct 2004, Loren Cain wrote:
> Without seeing your code, it's difficult to know what
> problem you are encountering. However, the following
> code works for me on Solaris 9:
>
> #!/usr/bin/perl
> $FILESPACE='/';
> my @cmd = "dsmc q backup $FILESPACE -su=yes -filesonly";
> foreach $line ( qx(@cmd) )
> {
> print "RESULT: $line";
> }
> exit(0);
>
> If you are trying to do this on Windows, as it appears
> you may be, you could be running into issues with Windows
> pipes. In such cases, it is often more reliable to redirect
> the output of the command to a temporary file and then read
> the file back in.
Yes, this testing is happening on windows. I wanted to stay
away from writing to disk.
Here are two different attempts to get this to work:
# get the list of files in TSM
unlink('x');
foreach my $fileset (keys %filesets) {
system("dsmc q backup c:\\ >> x");
}
__END__
# get the list of files in TSM
chdir('/cygdrive/c/progra~1/tivoli/tsm/baclient');
foreach my $fileset (keys %filesets) {
$cmd = q{dmsc q backup \\\\node\\c$};
open(TSM, "$cmd |") or die "$0: unable to execute dsmc: $!";
while(<TSM>) {
print $_;
}
}
|
|
|