Transfer files to remote host¶
Linux/Mac OS X¶
To transfer files use the command scp
.
The command scp
allows you to transfer files to and from a remote computer. It uses ssh
, which makes it extremely secure. Its syntax is as follows:
- If we want to transfer a file to the login node, we write:
# scp /path/to/file [username]@aristotle.it.auth.gr:path/to/destination/
- If we want to move a folder to the login node in order to include all of the contents along with the subfolders, we add the
-r
flag:
# scp -r /path/to/directory [username]@aristotle.it.auth.gr:path/to/destination/
- The corresponding commands are also used from the remote computer to our own:
# scp [username]@aristotle.it.auth.gr:path/to/file /path/to/destination/
and
# scp -r [username]@aristotle.it.auth.gr:path/to/directory /path/to/destination/
Windows¶
For transferring files to and from the login node, we can use MobaXterm.
The procedure for logging in to MobaXterm is described in Login via ssh. Transferring and arranging files can be done with drag and drop
.
WARNING
Before transferring files to the cluster, ensure that the filenames and contents of the files include only Latin characters as other characters like Greek may not be recognized by either the transfer program (e.g. MobaXterm) or the application that we will use later in the cluster.
Using dos2unix
Whenever we transfer text files that have been edited and saved on a Windows operating system to the cluster it is recommended to use
dos2unix
command line tool to update the new line terminator characters (from \r\n
to \n
), as in some applications (e.g. sbatch
) it may not work correctly (may not be able to correctly recognize the contents of the files). As an example, for a text file named file.txt
the command to use is as follows:
# dos2unix file.txt
Web portal¶
To transfer files to and from the cluster, we can use the Open OnDemand
web portal of the Aristotle computing cluster at https://hpc.auth.gr.
We can open the File Manager from the home page menu: Files
-> Home Directory
. Then follow the instructions for transferring files from the web portal of the computing cluster.