rsync¶
Description¶
Rsync is a fast and extraordinarily versatile file copying tool for both remote and local files.
Modules system sets up the following environment variables for this module:
Environment Modules¶
Run module spider rsync
to find out what environment modules are available for this application.
Environment Variables¶
- HPC_RSYNC_DIR - installation directory
- HPC_RSYNC_BIN - executable directory
Additional Usage Information¶
Rsync, which stands for "remote sync," is a utility for copying and syncing data between two computer systems. UFRC now provides a URL for users to rsync their data to and from the cluster. The basic syntax of the rsync command is:
[user@laptop ~]$ rsync options source destination
Some Common Options Used with Rsync Commands:
Option | Meaning |
---|---|
-a | Archive mode; allows copying files recursively and also preserves symbolic links, file permissions, user & group ownerships, and timestamps |
-v | Increase verbosity |
-r | Copies data recursively |
-z | Compress file data |
-h | Output numbers in a human-readable format |
Copying files to the cluster:¶
Example
Jane has started a new project called 'build_tree_xyz' on her laptop. She wishes to copy this project to the cluster to run some jobs related to the project. Jane runs rsync from her laptop to sync the project into her home directory.
If Jane's username on her computer is the same as her UFRC username, she can run:
[jane@laptop ~]$ rsync -av build_tree_xyz rsync.rc.ufl.edu:~
[jane@laptop ~]$ rsync -av build_tree_xyz jsmith@rsync.rc.ufl.edu:~
Copying files from the cluster:¶
Example
Jane's job writes some outputs to a directory on scratch '/blue/mylab/jsmith/build_tree_xyz_outputs/' and she wants to rsync those outputs to her laptop for further analysis.
Copying files between directories:¶
Example
Jane, of the "doe" group wants to copy a directory tree from one /blue directory to another.
Jane should login to hpg.rc.ufl.edu
and then run rsync as follows:
[janedoe@JanesMac]$ ssh jane@hpg.rc.ufl.edu
<Enter password>
[jane@login1 ~]$ rsync -av /blue/mygroup/jane/important_data /blue/mygroup/share/project/
Note the absence of a slash in the source directory. If a slash is present at the end of the source directory name then the contents of the source directory will be copied and not the directory itself.
References¶
- Visit the Rsync webpage: https://rsync.samba.org/
- Rsync Manual: On the command line, type
man rsync
There are also plenty of existing tutorials available on the web describing the various rsync options.
Categories¶
software, utility