RSync permissions

Status
Not open for further replies.

korna

Dabbler
Joined
Jul 13, 2014
Messages
15
I am trying to backup my complete mirror to another NAS (Zyxel) which is not running ZFS. After a bit of fighting I did get everything running except for a few hiccups... and now my FreeBSD/Freenas knowledge is running dry.

On the Zyxel I got an rsync daemon running with a separate authentication user inside the module.
Code:
[my-mod]
secrets file = /my/us/ofwhatever
path = /mnt/HD_a2/rsync/my-nas
comment = from my nas to this nas
read only = no
list = yes
uid = root
gid = wheel
auth users = rsync-user


On the Freenas I created a user named rsync-user and made it a member of wheel and my "superPeople" group. Next I created an rsync task and selected as user, rsync-user.

Like I said, this almost runs fine except for specific files such as the logs ".system/syslog/log/userlog".
Code:
Jul 29 14:04:04 me-nas rsync: rsync: send_files failed to open "/mnt/Mirror/.system/syslog/log/userlog": Permission denied (13)

(I guess) that makes sense because only root has read access to that file
Code:
-rw-------  1 root  wheel      31210 Jul 29 12:22 userlog

Similar for my .ssh directory but a different user
Code:
drwx------   2 me  superPeople     6 Jul 26 17:21 .ssh/


Is there anything I can do to make rsync copy everything without having these permission problems? Or am I doing/seeing this the wrong way?
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
If you're wanting to copy everything in your pool you should be just simply running rsync as root.
 

korna

Dabbler
Joined
Jul 13, 2014
Messages
15
I checked and the rsync task is running under the same user "rsync-user" which I specified in the UI.
Code:
rsync-user 63821  2.3  0.1  53936  7668 ??  S  11:57AM  0:12.52 rsync -r -t -z -a
rsync-user 63818  0.0  0.0  14496  1784 ??  Is  11:57AM  0:00.00 /bin/sh -c PATH="/
rsync-user 63819  0.0  0.0  3772  1212 ??  I  11:57AM  0:00.00 lockf -s -t 0 -k /
rsync-user 63820  0.0  0.0  9904  1336 ??  I  11:57AM  0:00.00 /usr/bin/logger -t


I feel a feature request coming :p
It would be nice if one can separately specify the authentication user

I'll check if there is a command line option for the authentication user so I can enter it in the extra option's field.


Thanks!
 

korna

Dabbler
Joined
Jul 13, 2014
Messages
15
the authentication user name is entered before the address of the daemon
Code:
rsync -avzh root@192.168.0.100:/home/ /tmp

I guess I can't manipulate that from that from the extra options field. However, there is an environment variable that can be changed.
Code:
USER or LOGNAME
The USER or LOGNAME environment variables are used to determine the default username sent to an rsync daemon. If neither is set, the username defaults to lqnobodyrq.

Anyone an idea if that can be manipulated from the extra options field?
 
Status
Not open for further replies.
Top