# Data transfer onto the HPC

At some point, you will inevitably need to get data from the HPC back onto your local machine, or vice versa. There are a number of different tools that can handle this, but for most use cases either [rsync](https://linux.die.net/man/1/rsync) or [scp](https://www.cyberark.com/what-is/scp-protocol/#:~:text=SCP%2C%20or%20Secure%20Copy%20Protocol,or%20between%20two%20remote%20hosts.) should suffice. 

#### Transfer using GUI application
If you would like to use a graphical user interface application, [CyberDuck](https://cyberduck.io/) is one such option. After you have [downloaded](https://cyberduck.io/download/) and opened the application, you will be met with a screen like this:

[![](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/scaled-1680-/image-1745416019341.png)](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/image-1745416019341.png)

To connect to your home directory on the HPC, click on 'Open Connection', then select SFTP from the dropdown. Enter in the address of the HPC in the `Server` section, **your** username and password, as well as the SSH private key used to connect to the HPC if you have one (not shown in this example).
[![](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/scaled-1680-/image-1745416299418.png)](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/image-1745416299418.png)

After hitting connect (click 'Allow' on the Unkown fingerprint popup), you will see the directory structure of the folders on the HPC in your home directory. 

[![](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/scaled-1680-/image-1745416343690.png)](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/image-1745416343690.png)

To download a file or directory simply right click it and hit download

[![](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/scaled-1680-/image-1745416383020.png)](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/image-1745416383020.png)

And to upload a file you click the 'Upload' button in the top right and browse your local files to upload

[![](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/scaled-1680-/image-1745416463260.png)](https://res-wiki.appstate.edu/uploads/images/gallery/2025-04/image-1745416463260.png)




#### Transfer using command line
**Rsync** is the most recommended:
* Efficient for large or incremental transfers.
* Automatically skips files that haven't changed.
* Can resume interrupted transfers.

To copy files **to** the HPC:

eg. A text file called `error.txt`
```
(base) azeezoe@BBMP814:~$ rsync -avhP error.txt azeezoe@hpc1.its.appstate.edu:/hpc/faculty/azeezoe/error.txt
azeezoe@hpc1.its.appstate.edu's password:
sending incremental file list
error.txt
            786 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)

sent 900 bytes  received 35 bytes  143.85 bytes/sec
total size is 786  speedup is 0.84

```
`-a` = archive (preserves permissions, etc.)

`-v` = verbose

`-h` = human-readable

`-P` = progress + resume

eg. To copy a *folder* (called `test_transfer`) **from** the HPC to your local computer
```
[azeezoe@hpc1 ~]$ ls test_transfer/
test_data.txt
```
Transfer it across from your local computer
```
(base) azeezoe@BBMP814:~$ rsync -avhP azeezoe@hpc1.its.appstate.edu:/hpc/faculty/azeezoe/test_transfer .
azeezoe@hpc1.its.appstate.edu's password:
receiving incremental file list
test_transfer/
test_transfer/test_data.txt
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/2)

sent 47 bytes  received 156 bytes  45.11 bytes/sec
total size is 0  speedup is 0.00
```
We can see that both the folder and data are transferred across
```
(base) azeezoe@BBMP814:~$ ls test_transfer/
test_data.txt
```

**Scp** can still be appropriate, for quick, secure, one-time transfers.
It's use is similar to rsync.

Transfer **to** HPC:
```scp -r /path/to/local_data user@hpc.example.edu:/path/to/remote_folder/```

Transfer **from** HPC:
```scp -r user@hpc.example.edu:/path/to/remote_data /path/to/local_folder/```

`-r` = recursive (needed for copying directories)