ropensci / ssh

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

cannot use wildcards with scp_download #53

Open scholzling opened 3 years ago

scholzling commented 3 years ago

Problem

I am trying to use scp_download() to download files matching a pattern from a remote server, but somehow it does not interpret wildcrads in the target argument and claims that the file does not exists. I verified that the file exists and that scp_download() works.

I am using Rstudio Version 1.4.1717 on Windows 10 and connect to a remote server running arch linux.

What ive tried

Command in bash:

$ scp licor@141.43.172.91:/home/licor/data/summaries/2021-* .

Output:

2021-07-23_smart3-00545_EP-Summary.txt        100%   31KB 257.0KB/s   00:00
2021-07-24_smart3-00545_EP-Summary.txt        100%   67KB 368.1KB/s   00:00
2021-07-25_smart3-00545_EP-Summary.txt        100%   67KB 430.0KB/s   00:00

Command in R

scp_download(session,"/home/licor/data/summaries/",to = temp_path_name)

Output:

 0 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries
     31388 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries/2021-07-23_smart3-00545_EP-Summary.txt
     69099 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries/2021-07-24_smart3-00545_EP-Summary.txt
     69106 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries/2021-07-25_smart3-00545_EP-Summary.txt
     68978 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries/2021-07-26_smart3-00545_EP-Summary.txt
     68975 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/summaries/2021-07-27_smart3-00545_EP-Summary.txt

Command in R:

 scp_download(session,"/home/licor/data/summaries/2021-07-23_smart3-00545_EP-Summary.txt",to = temp_path_name)

Output:

31388 C:\Users\Sebastian\Documents\normalising-data-parser\R\scp_1636031448/2021-07-23_smart3-00545_EP-Summary.txt

Command in R:

scp_download(session,"/home/licor/data/summaries/2021-*",to = temp_path_name)

Output:

Warning: SSH warning: scp: /home/licor/data/summaries/2021-*: No such file or directory