Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 (http://www.ncftp.com/).

Can you help me write a bash script who:

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

Thank you all!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Basically this should do the trick:

ncftpput -R -u username-here -p "password-here" 12.12.12.12 /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

 
discard

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.