Article 6QCES rsync does not preserve permissions of source files

rsync does not preserve permissions of source files

by
rhimbo
from LinuxQuestions.org on (#6QCES)
I am invoking /usr/bin/rsync (version 3.2.7, protocol version 31) with the following command to back up my home directory to an external hard drive:

Code:rsync -a -R -C -f'\''- /.cache'\'' 1> ~/.rsync/.rsync-messages.txt 2> ~/.rsync/.rsync-errors.txtPermissions are not preserved. On the destination, files have all the permissions
Code:-rwxr-xr-xand directories have the permissions
Code:drwxr-xr-xapparently disregarding the permissions of the file on the source.

I also tried the above rsync command with the --perms option added, which, according to the rsync man page says
Quote:
In summary: to give destination files (both old and new) the source permissions, use --perms.
I put the --perms as the last option on the command line so it would not be 'turned off' by other options (order matters according to the rsync man page).

According to the man page the -a (--archive) option is equivalent to -rlptgoD . And I don't think any of those options are the problem.

However, I am curious about the explanation of the --perms option. I've attached a screen grab of that part of the man page in order to preserve the formatting and accommodate easier reading.
https://imgbly.com/ib/i0nxJzks60

I don't understand the explanation of the "receiving directory's default permissions" and umask. I couldn't find any description in the entire man page. I wonder if this is the problem, if for some reason rsync is overriding my command line directive (--perms) to preserve source file permissions. Or perhaps I'm just not understanding this description of the --perms option.

My goal is simply to preserve file permissions on the backup.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments