How to rsync certain filename - quick question
Hi All
We have to rsync all files under a folder /scratch/a/b between hosts A and B. Under /scratch/a/b, there's a set of files with same filename but under different subdirectories at the same level: eg /scratch/a/b/config.txt /scratch/d/e/config.txt : : We're interested in only copying/syncing up the config.txt files but yet keep the same directory strucutres in A and B. ie no structural change but update only those config.txt files from A to B while keeping the rest of the files and directories structures intact. We're not sure how to include and exclude with rsync. Thanks |
just create a small txt file, call it excludes.txt and populate it as follows:
Code:
+ config.txt |
Hi lleb
This does not seem to work. No config.txt is copied. Any tips ? rsync -auvc --include 'config.txt' --exclude '*' --delete-delay /scratch/jobs root@host.com:/scratch/jobs Thanks |
you should adjust your format to the following:
Code:
--exclude-from=/path/to/excludes.txt you can add some variables to your script to address the pathing as that is typically what i do. Code:
HOMEDIR="$HOME" Code:
- *.tar |
Quote:
|
Quote:
Code:
rsync -auvc --include '*/' --include 'config.txt' --exclude '*' --delete-delay /scratch/jobs root@host.com:/scratch/jobs |
All times are GMT -5. The time now is 03:42 PM. |