DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2012-12-29 09:12:44

ottsm
Member
Registered: 2010-12-23
Posts: 44

Need help with rsync from DNS to another DNS group and owner names

I'm using rsync to keep the data from a new DNS345 to an old DNS323.

I can get everything to work but the problem I'm having is with the user and group names, rsync keeps trying to change them even though I'm using archive mode.

On one dns I use the following command line;

rsync -ain --stats --delete '/mnt/HD/HD_a2/Data Files' 'root@192.168.0.5:/mnt/HD/HD_a2'

The "n" is for a dry run, when I run it it shows that it is trying to change the owner and the group on the backup DNS to root versus preserving the original names.  I've tried using the "g" & "o" options even though the "a" option has those functions built, of course it didn't work also.  If I remove the dry run, rsync does try and change the owner and group but fails, it gives a bunch of error messages that are irritating.  If I use the same options for a local drive to local drive backup it doesn't do this.   

What am I doing wrong?  Of course I get the end result that I want but the error messages bother me. 


Note, the other DNS has rsyncd running, my rsyncd.conf file is setup as follows;

secrets file = <some private path>
strict modes = true
pid file =/var/run/rsyncd.pid
log file = <some log file>
use chroot = false
max connections = 2
max verbosity = 2
list = false
timeout = 600
refuse options = xattrs
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz *.rar

#shutdown access except for root and users
auth users =
hosts deny = *
read only = true
write only = true
uid = nobody
gid = 501

[root]
comment = Root location on DNS-345 with root permissions
hosts allow = 192.168.0.0/24
path = /mnt/HD/HD_a2/
auth users = root
uid = root
gid = root
read only = false
write only = false

[users]
comment = Root locations on DNS-345 with user permissions
hosts allow = 192.168.0.0/24
path = /mnt/HD/HD_a2/
auth users = root, <some user name>
uid = <some user name>
gid = <some group name>
read only = false
write only = false

Offline

 

#2 2012-12-29 09:20:15

ottsm
Member
Registered: 2010-12-23
Posts: 44

Re: Need help with rsync from DNS to another DNS group and owner names

I take that back, I removed the "n" option and it does change the user and group, before I was logged in as a user only rather then root, now it changes the owner and the group name.  I don't want this to happen.

Offline

 

#3 2012-12-29 10:36:37

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Need help with rsync from DNS to another DNS group and owner names

It's all in the rsync man page:

-o, --owner
    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.

    The preservation of ownership will associate matching names by default, but may fall back to using the ID number in some circumstances (see also the --numeric-ids option for a full discussion).

-g, --group
    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.

You should also read about --numeric-ids and consult the rsyncd.conf manual page as well about uid/gid.

Last edited by scaramanga (2012-12-29 10:47:42)


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#4 2012-12-30 03:34:45

ottsm
Member
Registered: 2010-12-23
Posts: 44

Re: Need help with rsync from DNS to another DNS group and owner names

Figured out what was going on.  Initially I used the built in WEB remote backup function built into the DNS345 and a DNS325 (I transferred the DNS323 drives to the DNS325).   I didn't have the same users setup in both units or for some reason it didn't assign the same users to the files in all cases.  Also the DNS345 will not accept a drive from the DNS323 or DNS325 so I was forced to transfer information this way.  So when I dumped all my files using these two NAS units it must have changed groups and owners at that time.

When I installed funplug and rsync on both units it was doing what it was suppose to do and make both copies the same.  Now that I'm logged in as root on both machines it will do what it is suppose to do.  I just didn't realize it because I hadn't realized the group and owner had actually changed.

Now that I understand what's going on it appears as I've upgraded from the DNS323, DNS325 and now the DNS345 that all the owner and groups information now varies across the board to the point where it almost doesn't matter anymore.  I may want to start fresh and change all the group and owner information to my user and group, and then assign user names for the wife and kids so I can start keeping track of those files separate.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB