Manually Copy Data from A1 -> A2
The rsync command can be used to easily copy data from A1 → A2. Here are instructions for doing so.
In the following example the user, represented by the environment variable $USER, will copy the directory called my_data, which is located under their home directory, to their home directory on a002 (Andromeda 2). The last character in the following command is a tilde “~”, which represents the home directory on the a002 remote host.
[l001 ~]$ rsync -avuz $HOME/my_data $USER@a002:~
Here is some more info about the command.
- -a: Archive mode; preserves permissions, timestamps, and symbolic links.
- -v: Verbose mode; shows you what files are being transferred.
- -u: Ensures that newer files on the destination do not get overwritten.
- -z: Compresses data during transfer, which can speed things up.
- $HOME/my_data: The directory or file you want to copy.
- Make sure to include a trailing slash if you want to copy the contents of the directory, not the directory itself.
- $USER@a002: Your username and the hostname of the Andromeda 2 login node.
- $USER@a002:/home/$USER: The directory where you want to copy the data on the destination node.
*If you are copying a large amount of data, consider running the rsync command within a screen or tmux session to prevent interruptions.
Setting Up Passwordless SSH (optional)
Passwordless SSH lets you log in without typing your password every time, making rsync transfers more convenient.
1. Generate SSH Keys (Only if you don’t have them already. To check if you have them, you can list the contents of $HOME/.ssh).
On a001, run:
ssh-keygen -t ed25519
- Press Enter to accept the default file location (~/.ssh/id_ed25519).
- When prompted for a passphrase, you can either enter one (for extra security) or press Enter twice to leave it blank.
ssh-copy-id $USER@a002
2. Test the Connection:
- If you set up everything correctly, you should be logged in without entering your password.
ssh $USER@a002 hostname
It should return the following:
a002.m31.bc.edu