Quantcast
Viewing all articles
Browse latest Browse all 4928

Raspberry Pi OS • Re: rsync files between two Pis that are owned by other than the sending user

I want to send some files from one Pi to another. They are owned by pi and group www-data. If I as user pi send them via rsync with the --archive option they end up being owned by pi but the group changes to pi as well. How do I send them and keep them pi:www-data?

From 'man rsync':
--group, -g
This option causes rsync to set the group of the destination file to be the same as the source file. If the receiving program is not running as the super-user (or if --no-super was specified), only groups that the invoking user on the receiving side is a member of will be preserved. Without this option, the group is set to the default group of the invoking user on the receiving side.

--owner, -o
This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user (see also the --super and --fake-super options). Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side.

Statistics: Posted by RonR — Sat Feb 24, 2024 12:55 am



Viewing all articles
Browse latest Browse all 4928

Trending Articles