ropensci / ssh

Native SSH client in R based on libssh
https://docs.ropensci.org/ssh
Other
127 stars 21 forks source link

problem using scp on a complete folder tree #44

Open luca-scr opened 4 years ago

luca-scr commented 4 years ago

I have an issue when I'm trying to ssh copy a complete local folder tree to a remote server. Here is the skeleton code I used:

library(ssh)
session <- ssh_connect("<user>@<server.address>")
scp_upload(session, files = "~/<local_path>/<folder>", to = "~/<remote_folder>")
ssh_disconnect(session)

The problem is that files are recursively copied from "~/<local_path>/<folder>" to "~/<remote_folder>/<folder>" and not to "~/<remote_folder>" as I would like to get. Any hints are welcomed.