Passer au contenu principal

Transfer files to/from Curnagl

How do I transfer my code to Curnagl ? How do I get my results back on my computer ?

 

There are two main options to transfer data to/from Curnagl:

1.  You are familiar with terminal/bash command lines: use the `scp` command, see below.

2.  You are used to work with graphic interfaces: use FileZilla, see below.

 

First option: scp command

scp <FILE_TO_COPY> <FOLDER_WHERE_YOU_PASTE_IT>

scp –r <FOLDER_TO_COPY> <FOLDER_WHERE_YOU_PASTE_IT>

The latter command refers to a folder transfer. To transfer a folder, add the recursive command –r after scp. 

From your own computer to the cluster. 

Never better than an example to understand this command. Suppose you have a file (of any type you want!) called tutorial on your own computer. Here are the steps to copy this file to Curnagl cluster: 

  1. Depending on your distribution.

LINUX: openopen a terminal in the folder where is the fifile tutorialle `tutorial`, or open a terminal and then use `cd`cd command to go to the right place.

 

  1. ede

  1. Linux: open a terminal in the folder where is the file `tutorial`, or use `cd` command to go to the right place. 


For MAC users: type `terminal`terminal in the search field, choose `terminal`, then use `cd`cd command to go to the right place. 

For WINDOWS users: type `cmd`cmd in the menu, choose `Command prompt`prompt or `PowershellPowershell`, then use `cd`cd command to go to the right place.pla ce.


  1. Open2. Open a second terminal (MAC: NoteShell and WINDOWS: … ). Connect to Curnagl with the ` ssh ssh` command you are used to.  


You now have two open terminals: one where you are on your OWNown computer and onone where you are connectconnected to Curnagl. Suppose you want to copy/paste `tutorial`tutorial to`to /users/<username>/<project>` on Curnagl, where <username>  is your username and <project>  is the folder where you want to paste `tutorial`tutorial. 


  1. 3. On the first terminal from step 1 (which can access tutorialaccess `tutorial` since file since you are supposed to be in the right folder), maketype the following command (it will ask for your password)password): 


`scp tutorial <username>@curnagl.dcsr.unil.ch:/users/<username>/<project>` 

 

One tip the reason to open the second terminal on Curnagl is that if your path where you want to paste `tutorial` is very long (e.g.  `/users/<username>/<project>/<sub_project>/<sub_sub_project>/<sub_sub_sub_project> `): use `pwd` command in the right folder, copy the whole path and paste it to the end of the `scp` command.

 A few tips: the reason to open the second terminal on Curnagl is that if your path where you want to paste `tutorial` is very long (e.g.  `/users/<username>/<project>/ <sub_project>/ <sub_sub_project>/ <sub_sub_sub_project> `): use `pwd` command in the right folder, copy the whole path and paste it to the end of the `scp` command 

You can check either the copy/paste performed well or not: use `ls` command on Curnagl and check either if `tutorial` file is there or not. 

 

From the cluster to your own computer. 

Only step 3 changes: 

` scp <username>@curnagl.dcsr.unil.ch:/users/<username>/<project>/tutorial .` 

In case you do not want to paste it in the current folder (that is for what `.` stands for at the end of the above command line), simply replacee `.` with the correct path.