Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading all files from an FTP Server [closed]

Tags:

linux

debian

ftp

I need to download everything from an FTP server to hosting on a different server. I have shell access only to the server I'm downloading the files to. How, using the Linux FTP command, can I download every file, creating the directories needed for them in the process?

like image 404
Navarr Avatar asked Jun 09 '10 04:06

Navarr


People also ask

How do I download multiple FTP files at once?

To download multiple files from FTP server, we use mget command. Using that command we can download more than one file at a time. To download multiple files specify wildcard character for specifying directory name do download all files from the directory.


2 Answers

Use wget in this manner (m for mirroring):

wget -m ftp://username:[email protected] 

If your username or password contains special characters, you may need to use the format:

wget -m --user=username --password=password ftp://ip.of.old.host 

Alternatively, I found this guide which shows you how to do it using ncftp in Debian. You will require root access to the new server if ncftp is not installed already.

In short:

sudo apt-get install ncftp ncftpget –T –R –v –u "ftpuser" ftp.nixcraft.net /home/vivek/backup /www-data 
like image 95
Emil Vikström Avatar answered Sep 18 '22 12:09

Emil Vikström


Another way is to use ftp. Here's an example shell script using ftp:

#! /bin/bash  ftp -n << 'EOF' open ftp.your_ftp_host.com quote USER your_username_here quote PASS your_password_here cd gets prompt no mget * . bye EOF 
like image 20
mgoldwasser Avatar answered Sep 18 '22 12:09

mgoldwasser