Versions Compared

Key

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

...

rsync is a very complicated program, with many options (http://rsync.samba.org/ftp/rsync/rsync.html). However, if you use the recipe shown here for directories, it's hard to go wrong:

rsync -ptlrvP avP local/path/to/source_directory/ local/path/to/destination_directory/

Both the source and target directories are local (in some file system accessible directly from ls5). Either full or relative path syntax can be used for both. The -ptlrvP options above stand for:

  • -p means a means "archive mode", which implies the following options (and a few others)
    • -ppreserve file permissions
    • -t
    means
    • preserve file times
    • -l
    means
    • copy symbolic links as links
    • -r
    means
    • recursively copy sub-directories
  • -v means verbose
  • -P means show Progress.

Since these are all single-character options, they can be combined after one option prefix dash ( - ). You could also use options -arvP, where ptlrvP, separately, instead of using -a means for "archive mode", which implies the -ptl options.

Tip
titleAlways add a trailing slash ( / ) after directory names

The trailing slash ( / ) on the source and destination directories are very important!

rsync will create the last directory level for you, but earlier levels must already exist.

Code Block
languagebash
titlersync (local directory)
cds
rsync -ptlrvPavP /work/projects/BioITeam/projects/courses/Core_NGS_Tools/custom_tracks/ data/custom_tracks/

...

Code Block
languagebash
rsync -ptlrvPavP /work/projects/BioITeam/projects/courses/Core_NGS_Tools/ucsc_custom_tracks/ data/custom_tracks/

...

Expand
titleStep 4 answer

From inside your ~/what/starts/here directory:

Code Block
titlePlay a scavenger hunt for more practice
rsync -ptlrvPavP /work/projects/BioITeam/projects/courses/Core_NGS_Tools/linuxpractice/changes/ changes/
# or
scp -r scp -r /work/projects/BioITeam/projects/courses/Core_NGS_Tools/linuxpractice/changes changes

# Then
cd changes 
more largeFile.txt
Expand
titleStep 5 answer

From inside your ~/what/starts/here/changes directory:

Code Block
titlePlay a scavenger hunt for more practice
rsync -ptlrvPavP corengstools@gapdh.icmb.utexas.edu:~/the/ the/
cd the
cat instr5.txt
cd world
cat instr6.txt

...