Upload Directory Tree To Remote FTP Server Recursively using NCFTP

Install ncftp client

Type the following apt-get command under Debian / Ubuntu Linux to install ncftp client, run:

$ sudo apt-get install ncftp

If you are RHEL / CentOS / Fedora Linux user, type the following yum command to install ncftp client (first turn on EPEL repo):

# yum install ncftp

Syntax and examples:

The syntax is as follows:

ncftpput ftp-host-name /path/to/remote/dir /path/to/local/dir
ncftpput -options ftp-host-name /path/to/remote/dir /path/to/local/dir

Try the ncftpput client command as follows:

ncftpput -R -v -u "username" ftp.yourdomain.com /www/forum /tmp/phpbb


-u “username” : Ftp server username
-v : Verbose i.e. show upload progress
-R : Recursive mode; copy whole directory trees.
ftp.yourdomain.com : Remote ftp server (use FQDN or IP).
/www/forum : Remote ftp server directory where all files and subdirectories will be uploaded.
/www/phpbb : Local directory (or list of files) to upload remote ftp server directory /www/forum

You can pass the password with -p option:

ncftpput -R -v -u "username" -p "passwordHere" ftp.yourdomain.com /www/forum /tmp/phpbb

You can use port number 2021 instead of the default FTP service port # 21 as follows:

ncftpput -R -v -u "username" -p "passwordHere" -P 2021 ftp.yourdomain.com /www/forum /tmp/phpbb

Leave a Reply