I AM TRYING TO DOWNLOAD FILES AND AND DIRETORIES,SUBDIRETORIES FROM FTP SERVER. IT IS NOT DOWNLOADING DIRECTORIES ,SUBDIRECTORIES AND CONVERTING .GZ FILES TO .TXT WHICHEVER FILES IT BROUGHT FROM REMOTE SERVER FROM FIRST LEVEL DIRECTORY. FOR REST IT IS GIVING SAME ERROR.

use Net::SFTP::Recursive qw(:all); use IO::Uncompress::Gunzip qw(gunzip $GunzipError); use Date::Simple qw(d8); use DBI; use DBIx::Dump; use Time::Piece; use Time::Seconds 'ONE_DAY'; my $host = "10.31.0.35"; my $user = "lho"; my $password = "lho"; my $basedir = "locations"; my$reportfldr = "reports"; my $reportdr ="Reports_On_Request"; my $filename = 'branchList1tst.txt'; $date = $ARGV[0]; # date is your first argument{ FORMAT + (20161125)}#### uncomment this line and enter date while running s +cript if #you want to manually fetch report and commnet below +block #autodate # my $out = qx(net time); #toget current date # my @sachin = split/\s+/,$out; #toget current date aut +odate # print "$sachin[5] \n"; #toget current date autodate # my @datesys = split/-/,$sachin[5]; #toget current date auto +date # my $dt_column = join ("",$datesys[2],$datesys[1],$datesys[0]); #toge +t current date autodate # $date =$dt_column; #toget current date autodate # my $yesterday= (localtime() -ONE_DAY)->ymd(''); #autodate # print "$yesterday \n"; #autodate # $date = $yesterday; #autodate #Starting of Main Program # my $d = d8($date); my $error_log=$d-> format ('%d/%b/%Y'); #my $brchid="b00330"; ####brchid it is reading from branchList file +##### open (STDERR,">",$error_log) ; ############Fetching report from LHO Server########################### +############# open(my $fh, '<:encoding(UTF-8)', $filename)or die "Could not open fi +le '$filename' $!"; while ( my $line = <$fh>) { chomp $line; my @splitline=split/[|]/,$line; my $brid = $splitline[0]; my $regn = $splitline[1]; print "Starting $branchname\t"; $brnchid = substr $brchid,1 ; print "$brnchid upload \n"; system "mkdir $brchid"; chdir($brchid); my $dir = join"/",$basedir,$brchid,$reportfldr,$date; print "$dir"; print " FTP is ongoing in main file \n"; my %args =( user =>'lho',password=>'lho',port=>22,debug=>2); my $f = Net::SFTP::Recursive->new($host,%args); $f->status; $f->ls($dir,sub {print $_[0]->{filename},"\n"}); $f->rget($dir,'E:\fastscript\reports trasnfer\tmp'); #$f->exit; print " FTP done \n"; close ($fh); }

Logs are as under

I03977DE207: sftp: Sent message T:11 I:14221 Couldn't get handle: Bad message at E:\fastscript\reports trasnfer\rep +orts.pl line 80. + making local dir E:\fastscript\reports trasnfer\tmp/../././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././../../../NFT_00317_27092019_27092 +019191651_952.TXT... + from locations/b06066/reports/20191225/../././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/./././././././././././../../../NFT_00317_27092019_27092019191651_952 +.TXT to E:\fastscript\reports trasnfer\tmp/../././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././././././././././././././././././././././././. +/././././././././././././././././././././././././././././././././././ +././././././././././././../../../NFT_00317_27092019_27092019191651_95 +2.TXT... I03977DE207: sftp: Sent message T:11 I:14222 Couldn't get handle: Bad message at E:\fastscript\reports trasnfer\rep +orts.pl line 80. FN: l LN: -rw-r--r-- 1 cdc branches 0 Mar 21 2018 l

In reply to Net::SFTP::Recursive not downloading files recuresively by sachin raj aryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.