rsync_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rsync_notes [2020/11/22 18:07] – raju | rsync_notes [2021/05/25 12:55] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== top level separation ===== | ||
+ | Situation: | ||
+ | I have a directory (say source/) with many sub directories and files under it (source/ | ||
+ | |||
+ | Solution: | ||
+ | There are two approaches I can think of. Both work. I prefer the second one as it is a bit cleaner. | ||
+ | |||
+ | Approach1: | ||
+ | < | ||
+ | rsync -prltvzD -n --delete-after --exclude='/ | ||
+ | rsync -prltvzD -n --delete-after --include='/ | ||
+ | </ | ||
+ | |||
+ | Approach2: | ||
+ | < | ||
+ | rsync -prltvzD -n --delete-after --exclude=' | ||
+ | rsync -prltvzD -n --delete-after --include=' | ||
+ | </ | ||
+ | |||
+ | In both approaches, the destA and destB directories will be created on the fly if necessary. | ||
+ | |||
==== useful links ==== | ==== useful links ==== | ||
* https:// | * https:// | ||
+ | ==== miscellaneous ==== | ||
+ | tags | include all sub directories but exclude top level files, exclude top level directory, exclude all subdirectories |
rsync_notes.txt · Last modified: 2021/05/25 12:55 by admin