-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSftp.R
36 lines (26 loc) · 1.26 KB
/
Sftp.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This code is for uploading and downloading large files using the OHDSI SFTP server. Requires an account.
keyFile <- "c:/home/keyFiles/study-coordinator-repro"
userName <- "study-coordinator-repro"
# Install required packages
install.packages("remotes")
remotes::install_github("ohdsi/OhdsiSharing")
# Upload vocabulary files (already zipped) -----------------------------
library(OhdsiSharing)
connection <- sftpConnect(userName = userName, privateKeyFileName = keyFile)
sftpPutFile(connection, "D:/Synpuf/Vocab/Vocab.zip")
sftpDisconnect(connection)
# Upload ETL-ed files (already zipped) --------------------------------
library(OhdsiSharing)
connection <- sftpConnect(userName = userName, privateKeyFileName = keyFile)
sftpPutFile(connection, "D:/Synpuf/EtlOutput.zip")
sftpDisconnect(connection)
# Download vocabulary files ---------------------------------------------
library(OhdsiSharing)
connection <- sftpConnect(userName = userName, privateKeyFileName = keyFile)
sftpGetFiles(connection, "Vocab.zip")
sftpDisconnect(connection)
# Download ETL-ed files ---------------------------------------------
library(OhdsiSharing)
connection <- sftpConnect(userName = userName, privateKeyFileName = keyFile)
sftpGetFiles(connection, "EtlOutput.zip")
sftpDisconnect(connection)