sanketbajoria / ssh2-promise

ssh with promise/async await and typescript support
https://www.npmjs.com/package/ssh2-promise
MIT License
148 stars 24 forks source link

Best way to upload a folder? #4

Closed nallown closed 6 years ago

nallown commented 6 years ago

What's the best way to upload a folder to a server? I tried using fastPut but that only works with single files. I need to upload a folder including its sub-directories and files.

sanketbajoria commented 6 years ago

There is no direct way to upload a folder.

I can think of two solution 1) Recursively walk through localfolder, and execute seperate command for creating file and folder 2) Zip the folder locally, send it via fastput, then execute the remote command for unzipping. Everything can be done via this tool

nallown commented 6 years ago

I decided to use rsync instead, there's also a node module for it that I used.