Net::SFTP questions
- From: don.scott@xxxxxxxxx (Don Scott)
- Date: Mon, 13 Aug 2007 14:35:06 -0700
I am in the process of removing the Net::FTP routines in some of my
older programs. I don't yet have the Net::SFTP and Net::SSH::Perl
modules installed (I don't have root on these systems). In the
meantime, I will probably do:
system "scp remotehost:/remotedir/remotefile /localdir/localfile";
system "ssh remotehost 'rm /remotehost/remotefile' ";
I don't like doing things this way, because if I understand correctly,
it's hard to get things to fail nicely (or fail at all) if one of the
system commands is unsuccessful.
If, and when, the Net::SFTP and Net::SSH::Perl modules get installed,
I was planning on doing something like this:
use Net::SFTP;
Net::SFTP->new($remotehost)
or die "could open connection to $remote_host\n";
$sftp->get($remotedir$remotefile)
or die "could not get $remotefile\n";
$sftp->do_remove($remotedir$remotefile)
or die "could not remove $remotedir$remotefile\n";
I am hoping that this is a sensible plan and that I've not overlooked
any serious weaknesses.
Thank you in advance for any comments and suggestions.
Don
.
- Follow-Ups:
- Re: Net::SFTP questions
- From: Don Scott
- Re: Net::SFTP questions
- Prev by Date: Re: import perl module after edit
- Next by Date: Re: Net::SFTP questions
- Previous by thread: Reg Expression Help
- Next by thread: Re: Net::SFTP questions
- Index(es):
Relevant Pages
|
|