# Uploading Your Data and Code

Although Microway provides sample applications and input data, many users need to upload their own application(s) and input data. Adept users will be more efficient on the command line (using the instructions shown below). Linux and Mac come pre-installed with the tools shown below. Windows users should use the [WinSCP tool](http://winscp.net/eng/index.php) (or similar). NoMachine users are able to transfer files from within the client - see [transferring files through NoMachine](https://www.nomachine.com/sharing-files-between-computers).

**All commands shown below should be run from your local system. They will not work when run on the cluster.**

## Copy files from your local computer to the cluster

```
scp -C -P 30007 localfile.txt username@gateway.microway.com:
```

```
scp -C -P 30007 -r localdir/  username@gateway.microway.com:
```

## Copy files from the cluster to your local computer

```
scp -C -P 30007 username@gateway.microway.com:remotefile.txt .
```

```
scp -C -P 30007 -r username@gateway.microway.com:remotedir/ .
```

*Take care to include the period shown above. It tells scp where to send the files. You could replace the . character with another directory on the local system, such as \~/Desktop/*

## Synchronizing files more efficiently

Linux and Mac users can take advantage of the `rsync` tool, which transmits solely file differences.

### Send all local changes to the cluster

```
rsync -e "ssh -p 30007" -avz project/ user@gateway.microway.com:project/
```

### Pull down all changes from the cluster

```
rsync -e "ssh -p 30007" -avz user@cluster:gateway.microway.com/ project/
```

Add `-n` to do a *dry run* (showing a list of the current file differences)

*Take care to include the final / characters shown above. Telling rsync to work on a name ending in / has a different meaning from a name that does not end in /*

## Direct access to cluster files

Linux and Mac users can use `sshfs` mounts to access the cluster filesystem from their local computer (with secure encryption in the background). Neither operating system comes pre-installed with the sshfs client, but it is easily obtained.

Once installed, a remote cluster directory can be mounted by running:

```
mkdir myproject
sshfs username@gateway.microway.com:project/ myproject/
```

Once mounted, all project files will be available in the `myproject/` directory as if they were on the local system.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://microway.gitbook.io/hpc-test-drive/uploading_your_data_and_code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
