Graham Leggett
2025-Apr-08 11:54 UTC
rsync --chmod affects the source permissions as well as destination permissions
Hi all, Another thing I've found is that my backups have lost their permissions. I misunderstood the --chmod option, thinking that it specified the permissions at the destination. What actually happens is that it overrides the source permissions, and has a side effect of the destination permissions being the same as the source. It looks like it works, when metadata is lost. I now need to fix this. What option will set the permissions on the destination side, while not affecting the permissions being fed into --fake-super on the source side? The end goal is a simple backup of a source filesystem preserving all users, all groups, all permissions, and all attributes, while the destination is a filesystem of a normal non-root user account. Regards, Graham --
Graham Leggett
2025-Apr-16 15:10 UTC
rsync --chmod affects the source permissions as well as destination permissions
On 08 Apr 2025, at 12:54, Graham Leggett via rsync <rsync at lists.samba.org> wrote:> Another thing I've found is that my backups have lost their permissions. > > I misunderstood the --chmod option, thinking that it specified the permissions at the destination. What actually happens is that it overrides the source permissions, and has a side effect of the destination permissions being the same as the source. It looks like it works, when metadata is lost. > > I now need to fix this. > > What option will set the permissions on the destination side, while not affecting the permissions being fed into --fake-super on the source side? > > The end goal is a simple backup of a source filesystem preserving all users, all groups, all permissions, and all attributes, while the destination is a filesystem of a normal non-root user account.I have proposed a --chmod-dest option to achieve this. The --chmod-dest option allows the destination permissions to be specified independently of the permissions backed up by --fake-super attributes. This means the source permissions are maintained, while on the backup machine permissions can be granted to allow specific users/groups to have read access to the backups. https://github.com/RsyncProject/rsync/pull/751 Regards, Graham -- -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20250416/b3fe15fa/attachment.htm>
Derek Martin
2025-May-05 19:14 UTC
rsync --chmod affects the source permissions as well as destination permissions
On Tue, Apr 08, 2025 at 12:54:24PM +0100, Graham Leggett via rsync wrote:> I misunderstood the --chmod option, thinking that it specified the > permissions at the destination. What actually happens is that it > overrides the source permissions, and has a side effect of the > destination permissions being the same as the source. It looks like > it works, when metadata is lost.[...]> > What option will set the permissions on the destination side, while > not affecting the permissions being fed into --fake-super on the > source side?If I understand correctly, I believe using --chmod without using --perms (or with --no-p) will do what you want. Typical command lines often use -a which equates to -rlptgoD (i.e. it includes -p/--perms). So you either need to not use -a and instead use the remaining combination of options explicitly, or use --no-p. See the man page, specifically the sections for --perms and -a. -- Derek Martin Principal System Software Engineer Akamai Technologies demartin at akamai.com