ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
which works.
I also tried using: --exclude {' Dbmysql/jquery', ' Dbmysql/js', 'Dbmysql/jquery-ui'} as given as a example on an internet site but doesn't work.
I also tried using --exclude-from='rsyncExclude.txt' which contains
Dbmysql/jquery
DBmysql/js
Dbmysql/jquery-ui
and does not work.
I havn't found any site to learn the correct syntax here so need help. hopefully with example.
The --exclude targets are better off inside quotes so that the shell does not process them first. I've found the --filter option easier in some context. But as mentioned already, check the manual page. It has the authoritative descriptions for both.
Please someone, tell me what --exclude=**/*trash*/ means?
It specifies that files matching that rule should be ignored. You can understand exactly what that rule does by checking the rsync man page.
The "INCLUDE/EXCLUDE PATTERN RULES" section of the rsync man page is:
Code:
o if the pattern ends with a / then it will only match a directory, not a regular file, symlink, or device.
o rsync chooses between doing a simple string match and wildcard matching by checking if the pattern contains one of these three wildcard characters: '*', '?', and '[' .
o a '*' matches any path component, but it stops at slashes.
o use '**' to match anything, including slashes.
it means that any path with any number of parent directories with the last directory having the string "trash" in its name, will be excluded from being copied. if that directory already exists at the destination and appropriate ownership and permission exist (or remote rsync is running with effective root credentials) the non-directory objects in that *trash* directory will not be excluded (by this --exclude).
what are you wanting to accomplish?
if you want to exclude both a directory and file objects in it, you will need two excludes. i do this in bash like this:
Please post your thread in only once in one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. Your two threads for this question have been merged into this one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.