Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

i.e. to copy from your campus laptop to your home directory on the BRB cluster:

  1. If you are not on campus, connect to the Weill VPN.

2. We recommend one uses screen program to conduct the copy in the background:

...

3. rsync -av laptopFromDir/ loginid@scu-login01.med.cornell.edu:~/loginToDir/

Info

Note: Be careful with or without the slashes using rsync. The above states "copy everything found under laptopFromDir to my home directory in a new directory called loginToDir that I previously created.

  1. Copy Files from Remote to Local

    1. Code Block
      rsync -av loginid@scu-login01.med.cornell.edu:~/loginToDir/ laptopFromDir/
  2. Copy a Directory Locally

    1. Code Block
      rsync -a /path/to/source/directory/ /path/to/destination/directory/

...

rsync is a powerful tool with many useful options. Here’s a quick list of examples:

  1. -a: Archive mode, preserving symbolic links, devices, attributes, permissions, and ownership.

    Code Block
    rsync -a /path/to/source/ /path/to/destination/directory/
  2. -v: Verbose mode, providing detailed information during the transfer.

    Code Block
    rsync -v /path/to/source/ /path/to/destination/directory/
  3. -r: Recursively syncs folders.

    Code Block
    rsync -r /path/to/source/ /path/to/destination/directory/
  4. -nv: Performs a verbose dry run, showing what the command would do without actually making any changes.

    Code Block
    rsync -nv /path/to/source/ /path/to/destination/directory/
  5. -z: Compresses the data during transfer to save bandwidth.

    Code Block
    rsync -az /path/to/source/ /path/to/destination/directory/
  6. -P: Combines --partial and --progress, keeping partially transferred files and showing progress during transfer.

    Code Block
    rsync -P /path/to/source/ /path/to/destination/directory/
  7. --delete: Deletes files in the destination that are not present in the source, ensuring the destination is an exact mirror of the source.

    Code Block
    rsync -av --delete /path/to/source/ /path/to/destination/directory/
  8. -t: Preserves modification times of files.

    Code Block
    rsync -t /path/to/source/ /path/to/destination/directory/
  9. --exclude: Excludes files matching specified patterns from the transfer.

    Code Block
    rsync -av --exclude='*.tmp' /path/to/source/ /path/to/destination/directory/
  10. --include: Overrides exclusions for specific patterns.

    Code Block
    rsync -av --exclude='*.tmp' --include='important.tmp' /path/to/source/ /path/to/destination/directory/