I am new in LFTP and trying to automate my file delivery through perl code using LFTP. I am able to set the proxy server and connect to remote host and also able to successfully transfer the file to remote host using perl code. But I am not able to get the response from lftp transfer which can let my perl job know that transfer is successfully completed due to this my perl job is failing considering there is some issue with the transfer. I have tried verbose option as well but it is also not displaying any response while transferring the file using lftp.
open(FTP,"lftp -vvv <command_file |")
command_file has below lines of code :
set ftp:proxy http://proxy_server:port
open ftp://remote_server_name
user user_name password
cd /remote_server_dir
put /local_server_file_name -o remote_server_file_name
Now after calling this code "FTP", file is successfully transferred to remote host but to validate it is successful I am using below code :
while(<FTP>)
{
print $_;
if ((/transferred/))
{
# successful
}
else
{
# not successful
}
}
LFTP while executing manually gives response like 300 bytes transferred
. And therefore I am trying to use keyword transferred
as a sign of successful transfer. But it seems while running this LFTP through perl I am not getting any response at all.
Please let me know how to get the response from remote server after successful transfer of the file through automated job. Thanks!