Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I upload an entire folder, that contains other folders, using sftp on linux?

I have tried put -r directory/*, which only uploaded the files and not folders. Gave me the error, cannot Couldn't canonicalise.

Any help would be greatly appreciated.

like image 374
Chris Avatar asked Apr 10 '12 07:04

Chris


People also ask

Can SFTP transfer directories?

SFTP Cheat Sheet PDF You should be able to connect to a remote server with SFTP and use commands to transfer files, manage files and directories, and change file permissions.

How do I SFTP multiple files in Linux?

Getting Multiple Files To download more than one file from the sftp server use the mget command. mget works by expanding each filename listed and running a get command on each file. The files are copied into the local working directory, which can be changed with the lcd command.


1 Answers

For people actually wanting a direct answer to this question (instead of being told to use something other than sftp)...

put -r local/path/to/directoryName 

The uploaded directory must already exist in the working directory on the server, so you might need to create it first.

mkdir directoryName 
like image 91
Ben Thielker Avatar answered Oct 06 '22 14:10

Ben Thielker