Using RSync with Regex#
Here is an example of a useful command1 to download files from osc to your local machine:
``rsync --dry-run --progress -rv --prune-empty-dirs \
--exclude='**/*allTree*'\
--exclude='**/Simulate*'\
osc:/fs/ess/PAS2608/Jason_test_runs/AIII* \
.
This will copy files that starts with “AIII” from the directory
/fs/ess/PAS2608/Jason_test_runs
onosc
to the current directory.
This script assumes that you have set up your ssh config. Otherwise instead of
osc
you need to type inusername@pitzer.osc.edu
and maybe enter your password afterwards.
The
--dry-run
flag tellsrsync
to not actually copy the files yet. There will be a list (might take a while to generate) at the end of the dry run for you to see if all the desired files are included (or excluded in this case).-r
stands for recursive.-v
stands forverbose
(might be the same thing as--progress
?)
- 1
See stackoverflow for more information.