3

When I am trying to sftp the directory structure ( Here the directory is having other directories recursively). I am not getting all the files.

Can you please suggest me the way to do this?

3 Answers 3

3

Another way to do this ( and it skips over files that are already copied )

rsync -av your/local/dir/ user@remotehost:/your/remote/dir/
1
  • Thanks a lot!! After hours of trying stuff that didn't work, your method worked for me. phew!! thx!
    – Amatya
    Sep 18, 2014 at 12:42
1

Use scp -r:

scp -r /your/local/dir user@remotehost:/your/remote/dir
1
  • 10 years down the line, but the question refers to 'getting' and this command is more like 'put'. Reverse the arguments if you want to copy from the remote to the local.
    – Tony Park
    Aug 24, 2021 at 13:36
0

Recent versions of OpenSSH sftp client also support recursive transfers:

sftp> get -r /remote/path /local/path

Though, my preferred almost-any-protocol command-line client is lftp!

You must log in to answer this question.