How would I setup rsync to copy my data to another rsync server

Status
Not open for further replies.

electricd7

Explorer
Joined
Jul 16, 2012
Messages
81
Hello,

I have a failing FreeNAS box and I want to backup the data on it so that i can re-create it on a new ZFS pool of disks. I don't have enough ports to create both pools at the same time, so I need to backup the data and then restore it after building the new pool. I have a little WD MyBook Live NAS device which I setup as an RSYNC server using this guide: http://www.smallnetbuilder.com/nas/nas-howto/31828-fun-with-rsync-and-more-on-the-wd-my-book-live.

My question is, how would I setup the FreeNAS side to replicate data to the WD NAS? I didn't understand the section on the WD setup where I setup the rsyncd.secrets file if I was supposed to put in the username/password of the local WD user or the remote FreeNAS user? I don't see a place to put in a password on the rsync portion of the FreeNAS rsync module. Essentially I just want to be able to copy data from FreeNAS to WD without a "middle-man" PC and thought this would be the easiest way. Can anyone help?
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
Hello,

I have a failing FreeNAS box and I want to backup the data on it so that i can re-create it on a new ZFS pool of disks. I don't have enough ports to create both pools at the same time, so I need to backup the data and then restore it after building the new pool. I have a little WD MyBook Live NAS device which I setup as an RSYNC server using this guide: http://www.smallnetbuilder.com/nas/nas-howto/31828-fun-with-rsync-and-more-on-the-wd-my-book-live.

My question is, how would I setup the FreeNAS side to replicate data to the WD NAS? I didn't understand the section on the WD setup where I setup the rsyncd.secrets file if I was supposed to put in the username/password of the local WD user or the remote FreeNAS user? I don't see a place to put in a password on the rsync portion of the FreeNAS rsync module. Essentially I just want to be able to copy data from FreeNAS to WD without a "middle-man" PC and thought this would be the easiest way. Can anyone help?
http://doc.freenas.org/9.3/freenas_tasks.html#rsync-tasks
 

electricd7

Explorer
Joined
Jul 16, 2012
Messages
81
Mlovelace- Respectfully, don't be a jerk. I read the manual.

I am specifically confused as to what username/password is used when configuring an rsync module and if I need to include that in the rsyncd.secrets file on the remote server of if there is a different way to set that up so that FreeNAS connects correctly to the WD Live.
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
Mlovelace- Respectfully, don't be a jerk. I read the manual.

I am specifically confused as to what username/password is used when configuring an rsync module and if I need to include that in the rsyncd.secrets file on the remote server of if there is a different way to set that up so that FreeNAS connects correctly to the WD Live.
I'm not being a jerk, it's all in the manual. Just read the manual and test your config.

Code:
secrets file
This parameter specifies the name of a file that contains the username:password and/or @groupname:password pairs used for authenticating this module. This file is only consulted if the "auth users" parameter is specified. The file is line-based and contains one name:password pair per line. Any line has a hash (#) as the very first character on the line is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don't work.
The use of group-specific lines are only relevant when the module is being authorized using a matching "@groupname" rule. When that happens, the user can be authorized via either their "username:password" line or the "@groupname:password" line for the group that triggered the authentication.

It is up to you what kind of password entries you want to include, either users, groups, or both. The use of group rules in "auth users" does not require that you specify a group password if you do not want to use shared passwords.

There is no default for the "secrets file" parameter, you must choose a name (such as /etc/rsyncd.secrets). The file must normally not be readable by "other"; see "strict modes". If the file is not found or is rejected, no logins for a "user auth" module will be possible.


https://www.samba.org/ftp/rsync/rsyncd.conf.html
 

electricd7

Explorer
Joined
Jul 16, 2012
Messages
81
I must be missing something...

I set resyncd.secrets file on the WD Live = "root:freenasrootpassword" but when I run the rsync module that I created on my FreeNAS I get the following error:

Jan 5 21:02:51 freenas rsync: TERM: Undefined variable.
Jan 5 21:02:51 freenas rsync: Password: @ERROR: auth failed on module rsync
Jan 5 21:02:51 freenas rsync: rsync error: error starting client-server protocol (code 5) at main.c(1636) [sender=3.1.1]

My rsync.log on the server shows the following:
2015/01/05 21:09:15 [13755] connect from www.freenas.local (192.168.88.230)
2015/01/05 21:09:15 [13755] auth failed on module rsync from www.freenas.local (192.168.88.230): password mismatch
 
Last edited:

electricd7

Explorer
Joined
Jul 16, 2012
Messages
81
Update...I got it. I ended up having to obscure the password for "root" from the rsyncd.secrets file. I guess FreeNAS doesn't send a password by default when you choose Rsync module and a username. Once I made that change and restarted the rsync daemon on the server it appears that it is working. Thank you for the help.
 

tigerfan

Cadet
Joined
Dec 3, 2014
Messages
4
I ended up having to obscure the password for "root" from the rsyncd.secrets file.

Can you explain how you did this - I am having same issue. Not sure about how to obscure passwords.
 

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
for those who did not figure it out, you simply remove the password from the rsyncd.secrets so that instead of user:password it only contains user:.
 
Status
Not open for further replies.
Top