[SOLVED] Backup rsync parameter --chmod=Du+wx and more questions
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Most of the parameters I found in the man pages and howtos. Not so --chmod=Du+wx. What does "D" do to the users write and execute permission? Why is chmod needed at all? Permissions should stay as they are originally I'd think...
Would "rsync -aHv --delete --delete-excluded ...{rest of parameters}" not be the same?
Why --include="/home/me/" --include="/home/"? The same, is it not?
What does this do --include="/home/me/**" --exclude="*"?
As explained in the man page, the D restricts the chmod to affect only directories. (And, of course, a user needs x and w in order to read and change a directory.)
The "D" makes that --chmod option apply only to directories. Yes, without that option, permissions are copied from the original.
The include/exclude rules can be mystifying even for an experienced user. I'll try to explain some of them.
The --exclude="*" excludes everything not explicitly included. Note that this rule is applied at every stage of directory recursion, so, for example, --include="/home/" would include the /home/directory but everything under it would be excluded by the --exclude="*" unless specifically included by some other rule.
The --include="/home/me/**" includes everything under /home/me (except for things explicitly excluded, such as ".cache*') but, again due to the --exclude="*", this rule would not even be visited without the --include="/home/me/".
Similarly, the --include="/home/me/" rule would not be visited were it not for the --include="/home/" rule.
The "INCLUDE/EXCLUDE PATTERN RULES" section of the rsync manpage includes a rather thorough note about how these rules interact with the "--recursive" (-r) option. Sometimes you have to read through that section several times while looking at your rule set to understand it.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by PTrenholme
As explained in the man page...
No, it is not (that is what I wrote and why I asked). At least not in what man pages are installed on my computer, neither, e.g. here http://linux.die.net/man/1/chmod. What are your sources? Thanks for your reply.
No, it is not (that is what I wrote and why I asked). At least not in what man pages are installed on my computer, neither, e.g. here http://linux.die.net/man/1/chmod.
The "D" is part of rsync's "--chmod" option, and is described in the rsync manpage:
Quote:
In addition to the normal parsing rules specified in the chmod(1)
manpage, you can specify an item that should only apply to a direc-
tory by prefixing it with a ’D’, or specify an item that should
only apply to a file by prefixing it with a ’F’.
Would "rsync -aHv" be identical to "rsync -rtDH --links -X -pEgo -v" or do I overlook something?
Close. You're adding "-X" (preserve extended attributes), which is not included in "-a", and also adding an extraneous "-E" (preserve executability), which is ignored when "-p" (preserve permissions) is enabled.
No, it is not (that is what I wrote and why I asked). At least not in what man pages are installed on my computer, neither, e.g. here http://linux.die.net/man/1/chmod. What are your sources? Thanks for your reply.
...
Ah, my bad! I assumed that, when you said "man page" you meant the rsync manual page. I see from you post that you were speaking about the chmod manual page. I was confused because --chmod is a rsync option, and, as such, well, I just assumed that's what you were talking about.
Sorry.
Anyhow, as I should have said, consult the description of --chmod in the rsync manual pages.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by rknichols
Close...
Umm, the second expression is from Backintime. I tried to simplify it. My version should obviously read "rsync -aXHv". Thanks for looking at it and helping .
Quote:
Originally Posted by rknichols
The "INCLUDE/EXCLUDE PATTERN RULES" section of the rsync manpage includes a rather thorough note about how these rules interact with the "--recursive" (-r) option. Sometimes you have to read through that section several times while looking at your rule set to understand it.
That is what I'm currently doing. These "Filter Rules" become easily fiendishly complex, because the position of any rule in the chain of rules governs rsync's actions (like firewall rules for IPTABLES). Lots of room for thought -- and error .
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by PTrenholme
...Anyhow, as I should have said, consult the description of --chmod in the rsync manual pages.
No need for blushes. As you can see I didn't even notice that chmod in ths case is a parameter of rsync and as such will be desribed in the rsync-man page (where I found it in the mean time)...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.