Copying files between different linux, MacOSX or UNIX servers can be done with scp command. Thus you can use scp to transport data between CSC and your local environment or between different file systems at CSC.
In the command above, no path or file name is defined in the second argument. This means that the file will be copied to the users home directory with the same name as in the local machine (data.txt). If you would like to use other locations or file name, these values can be defined after the : sign. For example the following command would copy the file data.txt to a directory data_files (a sub directory in the CSC home directory) and name the copied file as data_a2.txt
To copy complete directories you should use scp command with option -r. For example the command below copies a directory data_dir and all its content to Taito. In this case a directory data_dir will be created to directory /wrk/kkayttaj. The content of the data_dir in Taito will be the same as in the local computer including all the subdirectories.
Directory /wrk/kkayttaj is the work directory of user kkayttaj.
Copying the data from CSC environment to local computer is done in the same way. If for example file data.txt locates in the home directory of user kkayttaj it can be copied to the local machine with command:
But if the file locates in the work directory it should be copied with command:
You can check the explicit locations of different directories by first logging in to a server in CSC and then giving command
By default the copied files are treated as new files, but if you add option -p to the scp command, then the copied file will inherit the date and access mode information from the original file.
Previous chapter | One level up | Next chapter |