What the options to rsync does (the first hit on any of the exclusion/inclusion patters matters): Using a file of strings that need to be present in the directory names, a shell loop over these, and rsync (assuming we want to copy from the directory in the variable $source and to the directory in the variable $target): while IFS= read -r string do regextype sed -regex ".*/.*Full$"īut how can I add the list of IDs to this find command? So far this only comes to my mind to match Full:įind. How can I pipe the result of find to rsync?.How can I provide the list of patterns to find?.But how can I do this in a way to ensure all of the directories and sub-directories are checked and all of the relevant folders are copied even if they are buried very deep in several sub-directories (note that the above example was a simplified structure of my original folder). To my understanding, rsync does not support regex, therefore this has to be done with find first of all (correct me if I am wrong). Therefore in the example above, only the following directories (and all of their contents and sub-directories) should be copied: wr_we_LP02323_Full In other words, the directories that contain a string from the list above AND Full in their name (but NOT DAT) should be copied. I ONLY want to copy directories which have _Full at the end of their name ( DATFull directories should NOT be copied) AND also contain the patterns in the list below LP02323 For example 8Z12 does not contain only the three folders listed above, but it also contains thousands of files. And then there are also many subdirectories inside each. There are thousands of files in each and every folder listed above. I have a directory with the following structure: - 201893208
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |