Using sftp to Transfer a Directory?
sftp
, like cp
and scp
, requires that when you copy a folder (and its contents, obviously), you have to explicitly tell it you want to transfer the folder recursively with the -r
option.
So, add -r
to the command.
I can only suggest, you use rsync
. It is somewhat of an industry standard, when moving files over secure connections.
rsync -alPvz ./source_dir server.com:destination_dir
It is what I've been using for years by now.
(the -a
option takes care of things like directory recursion)
This works for me:
1) connect via sftp
to remote host
2) change into the remote directory you wish to copy. (Example: cd Music)
3) change to the local directory you wish to copy stuff to. (Example: lcd Desktop)
4) Issue this command: get -r *