Transferring Files¶
This section explains how to transfer files between the supercomputing system and your PC. It is assumed that Logging In to the System has already been completed.
File Transfer Using sftp¶
Files are transferred using the sftp command from “Command Prompt” on Windows, or “Terminal” on macOS and Linux.
$ sftp super.sc.imr.tohoku.ac.jp
Enter passphrase for key ‘/home/pc-user/.ssh/keys/id_rsa’:
sc-user@super.sc.imr.tohoku.ac.jp's password:
Connected to super.sc.imr.tohoku.ac.jp.
sftp>
Unless specified otherwise, the remote directory is the user’s home directory.
The basic commands are described below.
Command |
Function |
|---|---|
|
Displays the contents of the remote (destination) directory. |
|
Changes the remote current directory. |
|
Displays the contents of the local (source) directory. |
|
Changes the local current directory. |
|
Transfers a local file to the remote current directory. |
|
Transfers a local directory to the remote current directory. |
|
Transfers a remote file to the local current directory. |
|
Transfers a remote directory to the local current directory. |
|
Displays sftp usage and help. |
|
Terminates the connection. |
Attention
When transferring files with the put or get commands, if a file with the same name already exists at the destination, it will be overwritten.
Below are some usage examples.
Transferring a file named
test.txtin the local current directory to the remote host:
sftp> put test.txt
Uploading test.txt to /home/sc-user/test.txt
test.txt 100% 16 0.8KB/s 00:00
sftp>
Copying a directory named
testin the remote current directory to the local host:
sftp> get -r test
Fetching /home/sc-user/test/ to test
Retrieving /home/sc-user/test
/home/sc-user/test/test1.txt 100% 1855 39.0KB/s 00:00
/home/sc-user/test/test2.txt 100% 354 6.3KB/s 00:00
sftp>
File Transfer Using rsync¶
Files are transferred using the rsync command from Windows Subsystem for Linux (WSL) on Windows, or “Terminal” on macOS and Linux.
Example: Downloading files from the supercomputer to a PC:
$ rsync -auvHAS --stats sc-user@super.sc.imr.tohoku.ac.jp:/home/sc-user/source_directory /destination_directory
Enter passphrase for key ‘/home/pc-user/.ssh/keys/id_rsa’: your_ssh_passphrase
password: your_password
receiving incremental file list
...
Example: Uploading files from a PC to the supercomputer:
$ rsync -auvHAS --stats /source_directory sc-user@super.sc.imr.tohoku.ac.jp:/home/sc-user/destination_directory
Enter passphrase for key ‘/home/pc-user/.ssh/keys/id_rsa’: your_ssh_passphrase
password: your_password
sending incremental file list
...
The options used in the above examples are described below. For details, please refer to the rsync manual.
Option |
Function |
|---|---|
|
Preserves attributes (archive mode) |
|
Transfers only files that have been updated |
|
Displays detailed execution progress |
|
Preserves hard links |
|
Preserves Access Control Lists (ACLs) |
|
Handles sparse files efficiently |
|
Displays transfer statistics (number of files, transfer size, etc.) after completion |