Comments (5)
Hi, the error message says that the connection failed with a Time out, meaning that the server quagmire.igb.illinois.edu did not respond soon enough following the request to connect. It is hard to tell what the reason for this might be. If the download of each file takes considerable time, such as several minutes, it could be that your login session expires. You may have to modify your code a bit, so that you loop over your list of files to download one file at a time, and re-create the sftp_con object in each iteration, i.e. immediately before downloading each file. Please try it.
from sftp.
Hi, Stenevang:
Really appreciated for your quick response. I tried both ways for iterate/loop: for loop and purrr::map, but regrettably not working:
For loop
` ## for loop
for (i in 1: nrow(files_list)){
sftp_con <- sftp_connect(server = "sftp://quagmire.igb.illinois.edu/",
folder = "home/shared/licor_data/maize/raw/",
username = Sys.getenv("MY_SFTP_USER"),
password = Sys.getenv("MY_SFTP_PASS"),
protocol = "sftp://",
port = 22)
files_list <-
sftp_list(sftp_connection = sftp_con,
verbose = TRUE,
curlPerformVerbose = FALSE,
type = "file") %>%
tail(100)
sftp_download(files_list$name[i], tofolder = "./content/post/eddy_covariance/data/energy_farm/maize/",
verbose = TRUE)
}`
SFTP url: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
8521 file(s) in SFTP folder.
SFTP source: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
Save to folder: ./content/post/eddy_covariance/data/energy_farm/maize
1 file(s) to download.
2019-12-07T013000_AIU-0496_maize.ghg downloaded
1 file(s) downloaded.
SFTP url: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
8521 file(s) in SFTP folder.
SFTP source: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
Save to folder: ./content/post/eddy_covariance/data/energy_farm/maize
1 file(s) to download.
Error in function (type, msg, asError = TRUE) :
Failed to connect to quagmire.igb.illinois.edu port 22: Timed out
purrr::map
purrr::map(files_list$name, sftp_download, tofolder = "./content/post/eddy_covariance/data/energy_farm/maize/", verbose = TRUE)
SFTP source: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
Save to folder: ./content/post/eddy_covariance/data/energy_farm/maize
1 file(s) to download.
2019-12-07T013000_AIU-0496_maize.ghg downloaded
1 file(s) downloaded.
SFTP source: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
Save to folder: ./content/post/eddy_covariance/data/energy_farm/maize
1 file(s) to download.
2019-12-07T020000_AIU-0496_maize.ghg downloaded
1 file(s) downloaded.
SFTP source: sftp://quagmire.igb.illinois.edu/home/shared/licor_data/maize/raw/
Save to folder: ./content/post/eddy_covariance/data/energy_farm/maize
1 file(s) to download.
Error in function (type, msg, asError = TRUE) :
Failed to connect to quagmire.igb.illinois.edu port 22: Timed out
from sftp.
Hi, Stenevang:
I guess my issue might be similar to this stackoverflow question.
Would you mind take a looking?
Appreciated
from sftp.
Yes, it would be a good idea to expose the RCurl connecttimeout setting so that users can raise it when needed. I'll try to add that as soon as I have time.
from sftp.
connecttimeout setting added.
from sftp.
Related Issues (18)
- Timeout error in large list file transfer HOT 1
- sftp_listdirs typo HOT 1
- Publishing to CRAN HOT 4
- Add setting for connecttimeout HOT 1
- sftp_list fails with "error/vctrs_error_incompatible_type" error HOT 1
- support for custom RCurl / cURL options HOT 1
- Estimated timeline for keyfile implementaiton HOT 2
- Issue with getting SFTP data into R HOT 1
- Retry if download fails HOT 2
- Protocol "sftp" not supported or disabled in libcurl HOT 1
- Unspecified error on upload HOT 11
- Add check for sftp protocol support in curl installation HOT 1
- upload fails when fromfolder is absolute on linux/mac due to leading slash removal HOT 1
- sftp log uses deprecated `write_lines()`
- sftp_list Error in function (type, msg, asError = TRUE) HOT 6
- sftp for R 4.2.1? HOT 1
- sftp_connect Problem with whitespaces in paths
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sftp.