1/8/2024 0 Comments Grsync non regular files![]() ![]() The -exclude-from rsync option allows us to specify a file that contains a list of directories to be excluded. But that’s where rsyn’c other option -exclude-from comes into play. What if we want to exclude 15 directories? That command will be a monstrosity. The command above will do its job as expected, but as you can see, the command grows gradually more unwieldy as we append more excluded directories to it. ![]() $ rsync -av -exclude some/subdir/linuxconfig -exclude some/other/dir -exclude exampledir /path/to/src/ /path/to/dest/ Let’s try excluding three directories from our rsync transfer with this command: Now, how about multiple directories? We can use as many -exclude options as we want. $ rsync -av -exclude some/subdir/linuxconfig /path/to/src/ /path/to/dest/ In that case, our rsync command would look like this: Therefore, rsync assumes that directory linuxconfig is inside of /path/to/src.īut what if the linuxconfig directory is actually a bit deeper in our source directory? Let’s say that the absolute path to the directory we wish to exclude is actually /path/to/src/some/subdir/linuxconfig. Note, however, that the path to linuxconfig is relative to that of our source path, which in this case is /path/to/src. In the command above, we are synchronizing the contents of /path/to/src with that of /path/to/dest and omitting the linuxconfig directory. $ rsync -av -exclude linuxconfig /path/to/src/ /path/to/dest/ Here’s how it would be used to exclude the directory linuxconfig in the example command below. The first option we’ll cover is using the -exclude option in the rsync command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |