opening sftp command as a file
- From: kilarurajeev@xxxxxxxxx (Kilaru Rajeev)
- Date: Sun, 30 Mar 2008 13:43:49 +0530
Hi,
I am trying to run the following sub routine to copy a file from remote dir
to local. I am passing three arguments remote file, local file and the host
along with the user name. But, the program is not working. could somebody
please help me.
sub getFile {
my ( $rFile, $lFile, $rHost ) = @_;
my oldFile = $rFile.old;
open ( FH, "| sftp $rHost") or exception ( "Could not establish the sftp
connection");
print FH "get $rFile $lFile";
print FH "rename $rFile $oldFile";
print FH "exit";
close FH;
}
Thanks,
Rajeev Kilaru
- Follow-Ups:
- Re: opening sftp command as a file
- From: Jim Gibson
- Re: opening sftp command as a file
- Prev by Date: pdf protection for generated pdfs
- Next by Date: Re: Interpolate variable in a __DATA__ block
- Previous by thread: pdf protection for generated pdfs
- Next by thread: Re: opening sftp command as a file
- Index(es):
Relevant Pages
|