Help needed regarding perl script that uses SFTP
Posted on 2007-10-03
Help needed related to the below perl script. It is using SFTP to tranfer files, but i dont find any login info.
Is it trying to transfer from one server to another or on the same server. what the below code is trying to do.
How can we convert the following code which uses normal ftp.
while connect to ftp , should we compulsarily write use Net::FTP or is there any other way. If we want to connect
to the same server and transfer from one location to another using ftp, how can we achieve it.
# Reteive File using SFTP
open FT ,"|/usr/local/bin/sftp XFFILES";
print REQ "|/usr/local/bin/sftp XFFILES\n";
print FT "cd $copy_from_dir\n";
print REQ "cd ".$copy_from_dir."\n";
print FT "lcd $copy_to_dir\n";
print REQ "lcd ".$copy_to_dir."\n";
print FT "mget ".$price_file.".csv\n";
print REQ "mget ".$price_file.".csv\n";
print FT "bye\n";
print REQ "bye\n";
# Create File for Report Output to be viewed in Concurrent Manager
$reqfile = $applcsf."/".$applout."/o".$request_id.".out";
# Open File for Writing Output
open (REQ,">>$reqfile") || die "Could not Create";