Linux : Upload the files and directory tree to remote ftp server

by nixcraft on April 27, 2005 · 5 comments

When you host your web site remotely and use the open source software’s like wiki, phpbb etc uploading them is pain from UNIX or Linux based computer, especially when these software releases new security fixes you need to upload bunch of files and subdirectories. ncftpget client program is neat handy utility for recursive remote ftp server uploading purpose.

Try ncftpput as follows:

$ ncftpput –R –v –u "username" ftp.nixcraft.biz /nixcraft/forum /tmp/phpbb
-u "username" : Ftp server username
-v : Verbose i.e. show upload progress
-R : Recursive mode; copy whole directory trees.
ftp.nixcraft.biz : Remote ftp server
/nixcraft/forum : Remote ftp server directory where all files and subdirectories will be uploaded
/tmp/phpbb : Local directory (or list of files) to upload remote ftp server directory /nixcraft/forum

1) See ftptreeupload.bash script to copy all files and subdirectories recursively and upload them to remote FTP server (copy local all directories/tree to remote ftp server)

2) ncftpput can be downloaded from http://www.ncftp.com/ncftp/ and works with FreeBSD, Solaris and all most all UNIX variant

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 5 comments… read them below or add one }

1 SamTronik May 10, 2010

Thanks for this – saved me an age.

Just for those who dont work it out themselves, you can not copy and paste the command line as the – (minus/dash) sign is not the correct type. You will need to replace them with a dash from your keyboard. Something to do with the way the web formats them I guess.

Reply

2 happy halloween October 30, 2010

Jupp, saved my day uploading 300GB of data to a new repository with only ftp available…
Works fine with symbolic link in the filesystem.

Reply

3 vamsi krishna December 17, 2010

+1 for SamTronik, just type manually.
-R -v -u and so on..

Reply

4 Avin December 9, 2011

Can we also provide password in same command ?
If yes..How to do that ?

I want to use this in my script.

Reply

5 Lernen January 10, 2012

Hi, I am trying to upload a wordpress folder which contains some sub folders… but your command uploads everything in the root folder and is not creating any folders. …

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 3 + 11 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: