> >
> > I would like to use SSH to login to a remote system, then
> using FTP,
> > upload a file from the remote machine to another machine which will
> > display the data. If I can automate this process, I think
> I'll be in
> > great shape, tell me does this code seem like it would work
> for this?
Just a thought, if you're having trouble with the ssh part.
You could just use ftp for both servers?
use Net::FTP;
$ftpa = Net::FTP->new("a.host.name", Debug => 0)
or die "Cannot connect to a.host.name: $@";
$ftpb = Net::FTP->new("b.host.name", Debug => 0)
or die "Cannot connect to b.host.name: $@";
$ftpa->login($usera,$passa)
or die "Cannot login to A", $ftp->message;
$ftpb->login($userb,$passb)
or die "Cannot login to B", $ftp->message;
$ftpa->cwd("/files/blah")
or die "Cannot change working directory A", $ftp->message;
$ftpb->cwd("/foo/monkey")
or die "Cannot change working directory B", $ftp->message;
for(@filestotransfer) {
# then use $ftpa->read() and $ftpb->write() to xfr them between each other,
# sorry for lack of example I'm a bit busy!
}
$ftpa->quit;
$ftpb->quit;
Transfer files back and forth between the 2 Net::FTP objects. I'm not
saying it's better or anythgin, just another way to do it that may help
if ssh is being tricky as it some times can.
HTH
DMuey
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]