Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

This question already has an answer here:

I tried mget * but it only downloads files not folders. Is there a "download all" option?

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Dave, Tog, Dave M, Scott Apr 8 '13 at 16:53

This question was marked as an exact duplicate of an existing question.

See… – Lester Cheung Oct 12 '15 at 2:54

To recursively retrieve directories, you need to use the get -r directive. From the manpage of SFTP(1):

     get [-Ppr] remote-path [local-path]
             Retrieve the remote-path and store it on the local machine.  If the local path name is not specified, it is given the same name it has on the remote machine.  remote-path may
             contain glob(3) characters and may match multiple files.  If it does and local-path is specified, then local-path must specify a directory.
             If either the -P or -p flag is specified, then full file permissions and access times are copied too.
             If the -r flag is specified then directories will be copied recursively.  Note that sftp does not follow symbolic links when performing recursive transfers.

If this is meant to be run from a scheduled job, you need to add those commands to a batch file and use the -b option.

share|improve this answer

Perhaps the best way is to use wget or curl. Both are available in the CentOS repositories. Both are swiss army knife programs, you'd need to read the manual pages and see which one feels more natural.

share|improve this answer

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