Transfer files between your local machine and BriCS facilities¶
Prerequisites
To work through this guide you must
- Be a member of a project in the BriCS portal
- Have followed the instructions in Getting Started to set up SSH login and create a valid SSH certificate for authenticating to BriCS facilities (using the
cliftoncommand line tool) - PROJECT and FACILITY within this page correspond to the values that appear in SSH host names generated by
clifton, as described in the Login guide
Having setup ssh access as described in Getting Started, you can use scp or rsync to transfer files over SSH.
rsync on macOS
The version of rsync bundled with macOS is very old and can be significantly slower than current releases.
If you are on macOS, we recommend installing a newer version before transferring files:
- Homebrew:
brew install rsync(see brew.sh) - MacPorts:
sudo port install rsync(see macports.org)
For example to copy remote_file.txt from the remote login node to your local machine, the following can be used:
To copy local_file.txt from your local machine to the remote login node, the following can be used:
To copy local_file.txt from your local machine to another storage space on the BriCS facility e.g. your project public shared storage, the following can be used:
To copy a directory recursively, we use the -r flag with scp, and the -a flag with rsync. For example:
Transferring large number of files
Transferring a large number of small files can lead to inefficiencies as each file requires to be accessed, transferred and checked. It can be more efficient using the tar command to package up a large number of files into a single file to transfer.
For example to transfer using tar from a local machine to BriCS facility:
The cat > remote_file.tar command can be replaced with tar x to extract the archive automatically on the remote machine.
Alternatively to transfer using tar from BriCS facility to a local machine:
The > local_file.tar can be replaced with | tar x to pipe directly to tar to extract contents.
Finally, to extract a tar file local_file.tar with tar use tar xf local_file.tar