LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-05-2013, 09:22 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Backup rsync parameter --chmod=Du+wx and more questions


The command for my (successful) backups is generated by "backintime" as follows

Code:
rsync -rtDH --links -X -pEgo  --delete --delete-excluded  -v  
--chmod=Du+wx  --exclude="/Backup0/me" 
--exclude="/home/me/.local/share/backintime" --include="/home/me/" 
--include="/home/" --exclude=".gvfs" --exclude=".cache*" 
--exclude="[Cc]ache*" --exclude=".thumbnails*" --exclude="[Tt]rash*" 
--exclude="*.backup*" --exclude="*~" --exclude=".dropbox*" 
--exclude="/home/me/lost+found" --include="/home/me/**" 
--exclude="*" /
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="*"?

Any explanation would be highly appreciated .

Last edited by JZL240I-U; 03-05-2013 at 09:23 AM.
 
Old 03-05-2013, 10:00 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.)
 
Old 03-05-2013, 10:22 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
Old 03-06-2013, 01:19 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by PTrenholme View Post
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.

@ rknichols Thank you for your explanation .

Last edited by JZL240I-U; 03-06-2013 at 01:23 AM.
 
Old 03-06-2013, 09:31 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by JZL240I-U View Post
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’.
 
Old 03-06-2013, 09:58 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Ahhh, okay. In hindsight obvious where I should have looked . Thanks again .

Would "rsync -aHv" be identical to "rsync -rtDH --links -X -pEgo -v" or do I overlook something?

Last edited by JZL240I-U; 03-06-2013 at 09:59 AM.
 
Old 03-06-2013, 03:38 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by JZL240I-U View Post
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.
 
Old 03-06-2013, 06:32 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by JZL240I-U View Post
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.
 
Old 03-08-2013, 03:24 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
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 View Post
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 .

Last edited by JZL240I-U; 03-08-2013 at 04:01 AM.
 
Old 03-08-2013, 03:27 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by PTrenholme View Post
...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)...

Thanks for your help and patience .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync Chmod Problem lin*x Linux - Newbie 4 12-26-2013 03:36 PM
Rsync + hard links backup strategy questions TrainingPeaks Linux - Server 3 07-25-2012 10:59 AM
LXer: Rsync Backup for Windows, Linux Knoppix, and Other Smart Technologies in Handy Backup by Novos LXer Syndicated Linux News 0 12-24-2011 11:43 AM
LXer: Backup with rsync and rsync.net LXer Syndicated Linux News 0 09-14-2010 04:20 PM
What parameter do I add to RSYNC to update modified or new files to the destination? tankman1989 Linux - Software 2 02-20-2010 06:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration