Difference between revisions of "Rsync"
Jump to navigation
Jump to search
Line 55: | Line 55: | ||
<source lang="bash" enclose="div"> | <source lang="bash" enclose="div"> | ||
[jane@laptop ~]$ rsync -av jsmith@rsync.rc.ufl.edu:/scratch/lfs/jsmith/build_tree_xyz_outputs ~ | [jane@laptop ~]$ rsync -av jsmith@rsync.rc.ufl.edu:/scratch/lfs/jsmith/build_tree_xyz_outputs ~ | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==Copying files from /scratch/lfs to /ufrc== | ||
+ | |||
+ | {| style="border:1px solid #0021A5; background-color:#f0f8ff; width:50%; padding:5px;" | ||
+ | | style="padding:10px;" | '''Example''': Jane, of the "doe" group wants to move her important data from /scratch/lfs/ to /ufrc to complete her migration to HiPerGator 2.0. | ||
+ | |} | ||
+ | |||
+ | Jane should login to dtn1 after logging into hpg2.rc.ufl.edu and then run rsync as follows: | ||
+ | <source lang="bash" enclose="div"> | ||
+ | [janedoe@JanesMac]$ ssh jane@hpg2.rc.ufl.edu | ||
+ | <Enter password> | ||
+ | [jane@gator4 ~]$ ssh dtn1 | ||
+ | [jane@dtn1 ~]$ rsync -av /scratch/lfs/jane/important_data/ /ufrc/doe/jane/ | ||
</source> | </source> | ||
Revision as of 12:41, 10 May 2016
Overview
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, files 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:~
If Jane's username on her computer is different than her UFRC username, she needs to run:
[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 '/scratch/lfs/jsmith/build_tree_xyz_outputs/' and she wants to rsync those outputs to her laptop for further analysis. |
Jane should run:
[jane@laptop ~]$ rsync -av jsmith@rsync.rc.ufl.edu:/scratch/lfs/jsmith/build_tree_xyz_outputs ~
Copying files from /scratch/lfs to /ufrc
Example: Jane, of the "doe" group wants to move her important data from /scratch/lfs/ to /ufrc to complete her migration to HiPerGator 2.0. |
Jane should login to dtn1 after logging into hpg2.rc.ufl.edu and then run rsync as follows:
[janedoe@JanesMac]$ ssh jane@hpg2.rc.ufl.edu
<Enter password>
[jane@gator4 ~]$ ssh dtn1
[jane@dtn1 ~]$ rsync -av /scratch/lfs/jane/important_data/ /ufrc/doe/jane/
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.