Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on a Debian box, which I can't modify in any way.

I need to upload an entire directory (and subdirs) content to my server.

The only tool I've got is ncFTP (

Can you help me write a bash script who:

  • connect to with given credentials
  • put recursively the content of /mydir/*
  • overwrite existing files without asking anything

Thank you all!

share|improve this question
up vote 2 down vote accepted

Basically this should do the trick:

ncftpput -R -u username-here -p "password-here" /remote/dir /my/local/dir

Of course you replace username, password, IP and directories with your information :)

share|improve this answer
Thank you! I believe this is what I've been looking for but... it hangs a few seconds then says 'Killed'. Consider that doing the same manually with ncftp works correctly. Where does it log? – Fabio B. Jun 13 '11 at 10:31
Sorry! My destination folder had "/" at bottom. Now it works! Thanks :) – Fabio B. Jun 13 '11 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.