System Administration‎ > ‎Linux‎ > ‎FTP‎ > ‎

FTP recursive download using ncftp client

FTP recursive download using ncftp client

  • ncftpget is an tool included in ncftp client can be used to download ftp directory/site recursively.
  • ncftp is available on most of the platforms, Linux, Solaris, Freebsd, Mac OS and Windows(via cygwin).
  • to install ncftp on Debian/Ubuntu Linux:
    • sudo apt-get install ncftp
  • to get/download FTP directory recursively
    • ncftpget -R -v -u 'ftpuser' -p 'ftppassword' ftp.yourdomain.org /local/backup/ /pub/dir
      • -R : Copy all subdirectories and files (recursive)
      • -v : Verbose i.e. display download activity and progess
      • -u 'ftpuser' : FTP server username, if skipped ncftpget will try anonymous username
      • -p 'ftppassword' : FTP password
      • ftp.yourdomain.org : FTP server name/address
      • /local/backup : Download everything to this directory
      • /pub/dir : Remote ftp directory you wish to copy
  • If you get an error which read as follows:
  tar: End of archive volume 1 reached
  tar: Sorry, unable to determine archive format.
  Could not read directory listing data: Connection reset by peer
  • Then add –T option to ncftpget command:
    • ncftpget -T –R –v –u 'ftpuser' -p 'ftppassword' ftp.yourdomain.org /local/backup/ /pub/dir
      • -T : Do not try to use TAR mode with Recursive mode

Comments