Folks-- I'm working with an old system I set up to copy files from one local directory to another. I was using rdist for this, but I would prefer to shift it over to rsync. The one thing I'm missing is the trivial ability to force the group owernship of the destination files to a specific group. A read through the manpage and various searches on the web do not turn up any helpful hints in this regard. What I would really like is something like: rsync --other-options-here --owner=someuser --group=somegroup source/ dest/ Regardless of the source/ ownership and group, files copied to dest/ are created with owner 'someuser' and group 'somegroup'. Similar to the normal --owner and --group behavior, this would require --super behavior. Presumably, if the inspected files in dest/ had different ownership info, they would be updated to have the 'correct' info, same as if someone had done a chown -R someuser:somegroup in the destination directory. If this capability does not exist, would this be a reasonable extension of the --owner and --group options? Cheers, --Kyle
On Mon, Mar 01, 2010, Kyle Lanclos wrote:>Folks-- > >I'm working with an old system I set up to copy files from one local >directory to another. I was using rdist for this, but I would prefer >to shift it over to rsync. > >The one thing I'm missing is the trivial ability to force the group >owernship of the destination files to a specific group. A read through >the manpage and various searches on the web do not turn up any helpful >hints in this regard.If you connect to an rsync daemon you can specify the user and group on a per-module basis with something like this in your rsyncd.conf file: [bills_home] uid = bill group = staff read only = false path = /home/bill hosts allow = 192.168.0.0/24 hosts deny * The appropriate rsync command would be something like rsync -aHrx /home/bill/ destsys::bills_home/ Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792 Financial panics, if left alone, rarely cause much damage to the real economy, output, employment or production. Asset values fall sharply and wipe out those who borrowed and lent too much, thereby redistributing wealth from the foolish to the prudent. -- Arthur Laffer
On Mon, 2010-03-01 at 14:01 -0800, Kyle Lanclos wrote:> The one thing I'm missing is the trivial ability to force the group > owernship of the destination files to a specific group. A read through > the manpage and various searches on the web do not turn up any helpful > hints in this regard. > > What I would really like is something like: > > rsync --other-options-here --owner=someuser --group=somegroup source/ dest/ > > Regardless of the source/ ownership and group, files copied to dest/ are > created with owner 'someuser' and group 'somegroup'. Similar to the normal > --owner and --group behavior, this would require --super behavior. > > Presumably, if the inspected files in dest/ had different ownership info, > they would be updated to have the 'correct' info, same as if someone had > done a chown -R someuser:somegroup in the destination directory.See the --usermap and --groupmap options that are in the current development rsync and available in a patch "usermap.diff" for 3.0.7. -- Matt