How do I transfer files to and from Yen Servers using rsync?

Instead of using scp, we can use rsync for file transfers to and from Yen servers.

Transferring Files to Yen Servers

To transfer a file (e.g., myfile.csv) from your local machine, use:

$ rsync -aP myfile.csv <SUNetID>@yen.stanford.edu:/zfs/projects/students/<my_project_dir>

You’ll be prompted to enter your password and complete the two-step authentication process.

Transferring Folders to Yen Servers

To transfer a folder, add the recursive flag (-r) to rsync:

$ rsync -aPr myfolder/ <SUNetID>@yen.stanford.edu:/zfs/projects/students/<my_project_dir>/myfolder

Transferring Files from Yen Servers

To copy a file (e.g., my_remote_file.csv) from Yen servers to your local machine, use:

$ rsync -aP <SUNetID>@yen.stanford.edu:/zfs/projects/students/<my_project_dir>/my_remote_file.csv .

For transferring folders from Yen servers, include the -r flag:

$ rsync -aPr <SUNetID>@yen.stanford.edu:/zfs/projects/students/<my_project_dir>/my_remote_folder/ myfolder/

The above command will copy a folder named my_remote_folder on ZFS in /zfs/projects/students/<my_project_dir> to the current working directory on your local machine and name the folder myfolder.