1

Currently I am using SFTP to transfer .HTML and .JS files to my remote filesystem.

I have to type:

sftp [email protected]

And then manually change remote directory to /var/www/html, and upload files individually.

I can simultaneously upload all the files in a directory using *, but this doesn't appear to work for subdirectories.

Is there any way of copying an entire tree?

Is it possible to make a script that changes to the correct folder and performs the copy?

1
  • 4
    Have you tried scp -r? You should have no problem if ssh is not restricted, otherwise you can use lftp client, it allows you to mirror trees. Commented Jul 15, 2015 at 15:31

1 Answer 1

1

Use put -r. The sftp client in openssh-clients-6.4 knows the -r option, some older clients don't.

You might also want to have a look at the -p option (preserve).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.