Versions Compared

Key

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

...

  • -a means "archive mode", which implies the following options (and a few others)
    • -p – preserve file permissions
    • -t – preserve file times
    • -l – copy symbolic links as links
    • -rrecursively copy sub-directories
  • -v means verbose
  • -W means transfer Whole file only
    • Normally the rsync algorithm compares the contents of files that need to be copied and only transfers the different parts.
    • For large files and binary files, figuring out what has changed (diff-ing) can take more time than just copying the whole file.
    • The -W option disables file content comparisons (skips diff-ing).

Since these are all single-character options, they can be combined after one option prefix dash ( - ). You could also use options -ptlrvW, separately, instead of using -a for "archive mode".

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

The trailing slash ( / ) on the source and destination directories are very important for rsync (and for other Linux copy commands also)!

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

Tip
titleUse -W option when transferring large files

Another useful option is -W (copy Whole files only). In its normal mode, rsync will copy only changed parts of newer files. For large files, figuring out what has changed (diff-ing) can take more time than just copying the whole file. The rsync -W option says to skip diff-ing.important for rsync (and for other Linux copy commands also)!

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

Code Block
languagebash
titlersync (local directory)
mkdir -p $SCRATCH/data
cds
rsync -avPavWP $CORENGS/custom_tracks/ data/custom_tracks/

...

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

...