generated from allisonhorst/meds-distill-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathday2-server_uploading.qmd
54 lines (31 loc) · 1.6 KB
/
day2-server_uploading.qmd
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: "Uploading things to a server"
---
You have several options to upload files to the server. Some are more convenient if you have few files, like RStudio interface, some are more built for uploading a lot of files at one, like specific software... and you guessed it the CLI :)
### RStudio
You can only upload one file at the time (you can zip a folder to trick it):
![](img/rstudio-upload.png)
## sFTP Software
An efficient protocol to upload files is FTP (File Transfer Protocol). The `s` stands for secured. Any software supporting those protocols will work to transfer files.
We recommend the following free software:
- Mac users: [cyberduck]( https://cyberduck.io)
- Windows: [WinSCP](https://winscp.net/eng/index.php)
![](img/server-cyberduck.png)
## scp
The `scp` command is another convenient way to transfer a single file or directory using the CLI. You can run it from Bren server or from your local computer. Here is the basic syntax:
```
scp /source/path hostname:/path/to/destination/
```
Here is an example of my uploading the file `10min-loop.R` to workbench-1 from my laptop. The destination directory on workbench-1 is `/Users/brun/`:
```bash
scp 10min-loop.R brun@workbench-1.bren.ucsb.edu:/Users/brun/
```
BTW try to open and run that script for fun!!
If you want to upload an entire folder, you can add the `-r` option to the command. The general syntax is:
```bash
scp -r /path/to/source-folder user@server:/path/to/destination-folder/
```
Here is an example uploading all the images in the `myplot` folder
```bash
scp -r myplot brun@workbench-1.bren.ucsb.edu:/Users/brun/plots
```