FreeNAS to QNAP RSYNC Guide

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
Hello all, wondering if someone can outline the steps to setup Rsync from FreeNAS to QNAP. I have seen some bits and pieces of how to do it but cant seem to find documentation that is detailed enought for me to make it work. I am running FreeNAS 9.10 and QNAP 4.3.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
What's the problem, exactly? Have you read man rsync and the relevant manuals for FreeNAS and QNAP?
http://doc.freenas.org/9.10/services.html#rsync

I don't use rsyc, but I have little reason to believe it's rocket science, so just try to set it up and see where it goes from there. At least the FreeNAS side should be easy with the manuals.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
We can help with the FreeNAS side, because we use that. What support does the QNAP provide for rsync or SSH?
 

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
I have tried to follow the procedure at the link below. I think my problem is with the rysnc password part on the FreeNAS side. I have created a user in QNAP and assigned it to the QNAP Rsync service. I have the same user with the same password on the FreeNAS side. I have then created the rsync.pwd file and input the password matching the users on both the QNAP and FreeNAS Rsync account. The file is located at /mnt/rsync.pwd. I think my issue is I need to give the user account I created for the Rsync task Read access to the password file but I am not sure how to do that. I am also not sure how to see a log file to see what is failing.

https://geeklingo.net/setting-rsync-freenas-qnap/
 

Morpheus187

Explorer
Joined
Mar 11, 2016
Messages
61
Hey

I'm doing an rsync task to a Synology nas which works in a similar manner, I also created a password file and added an rsync task to FreeNAS with the following option: ( at the end: Extra Options )
Code:
--password-file=/mnt/VOL1/rsync.pwd



You can also add this option to let it write a logfile
Code:
--log-file=/mnt/VOL1/rsynclog


See the screenshot for my first page of the task.
 

Attachments

  • BACKUP.png
    BACKUP.png
    22.1 KB · Views: 2,053
Last edited by a moderator:

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
What is the reasoning for adding "admin@192.168.2.10" in the Remote Host Field? I have not seen any information that says to add a user in this area. I see that your user "morpheus" is not the same as the Remote Host Field.
 

Morpheus187

Explorer
Joined
Mar 11, 2016
Messages
61
admin is the user on the Synology as which has write access to the share. I think I tried it with another user but it didn't worked out. When you hover over the "i" button in the FreeNAS gui it actually says:
"IP Address or hostname. Specify user@hostname or user@ip-address if your remote machine user and above rsync task user are different."
 

neosbc

Cadet
Joined
Oct 13, 2018
Messages
7
Hi read guides for backup the FREENA to Qnap bay rsync , but is impossible.,


The errors are:
[42248] rsync: could not open password file /mnt/tank/rsync.pwd: Permission denied
[42248] rsync error: syntax or usage error (code 1) at authenticate.c(187) [sender=3.1.3]

- Other question the rsync.pwd file inside are paste user:pass in the textedit of windows is correct?
- My extra options in Freenas put this:

--password-file=/mnt/tank/rsync.pwd
--log-file=/mnt/tank/Multimedia/rsynclog


Is correct?


Thx
 
D

dlavigne

Guest
Were you able to resolve this? If not, which version of FreeNAS and which Guide did you use?
 

dmontcdn

Cadet
Joined
Jan 12, 2020
Messages
1
I know that this is an old post but, for the sake of others looking to do this, this is what worked for me.
My environment is a home built FreeNAS server (9.10.2) using rsync to a QNAP TS-251+

I created a user on both devices called "nassync" with the same password and also used this as the rsync user on the QNAP in the rsync server settings of Backup Station. I then created a couple of shared folders on the QNAP for testing and gave the nassync user read/write rights to those folders.
With this basic setup I was able to create a one-way sync job on the QNAP that did a push to the FreeNAS server.

When I tried to do a push from the FreeNAS server to the QNAP I ran into problems similar to those mentioned in the previous posts, imcluding the permission errors on the rsync.pwd file that I had created. Initially though, I was getting an error in the log file claiming the rsync module name was wrong or couldn't be found. I used the following command to discover the module name, as suggested in other posts:

#rsync <qnap IP address>::

This returned the name of the QNAP NAS which I used in the FreeNAS module name field for the push job. This did not work. What I found did work was using the shared folder name as indicated in the /etc/rsyncd.conf file (in this case "Test"). This must have been added when I created the shared folders in the QNAP user control panel. This resolved the module name error, however I still had the passwords file permission error. I changed permissions for the file to 600, but this didn't resolve it. It turned out that I had created the file while logged into the shell as root and had forgotten to change the ownership of the file. Once I changed the owner to the nassync user everything started working.

Hope this helps somebody down the road...
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
hi dmontcdn,

please help, i need to rsync my freenas to my qnap TS-832X,
i've tried :
rsync username@<qnap IP address>:: <-- username in qnap the input the password then it's work .
but i don't have any idea , how to put the username and password my qnap folder share in freenas ,
i read from above there's : mnt/tank/rsync.pwd
what exactly rsync.pwd content ? and how to create that file and what the content of that file ( how to write down in there ? )
and did i have to put "
--password-file=/mnt/VOL1/rsync.pwd
in extra option in freenas rsync task ?

please can help me, give more detail how to do ?

Thank you and regards,
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
i've got the solutions for rsync from freenas to qnap :


QNAP site :

  1. Setup share folder in our QNAP that you want to rsync from your freenas
for ex : Freenas
1.png



2. setup your rsync server on your QNAP from menu “ Backup Station “ like below :

2.png


make sure that username and password that you’re using, same as with username in freenas that you will going to rsync

Freenas site :

  1. create account with username and password same as username password in QNAP ( look point 2 )
  2. set this account full access to the dataset that you want to rsync
  3. create new folder for store file for password that you will use for the username :
  • touch /mnt/Data/passwordlocationstore/rsync.pwd
  • just write only and only your password in that file ex : password
4. set the user account that you will use for rsync full access that folder “passwordlocationstore” .

5. create rsync task in freenas like below :


3.png





4.png


extra option is : where the password file located (point no.3)



6. End ( you can test run rsync to make sure it’s running )


Regards,
 

FosCo

Dabbler
Joined
Sep 20, 2020
Messages
23
Thanks for this great guide!
Finally managed to get it to work.
Those two extra steps finally made it work for me:
* Do a rsync test with the user you are planning to use from commandline to accept the certificate of the remote machine (QNAP)
* set chmod 600, otherwise rsync will fail / Use a dataset with "Generic" / Unix permissions
 

giuseppe30

Dabbler
Joined
Dec 20, 2020
Messages
36
i've got the solutions for rsync from freenas to qnap :


QNAP site :

  1. Setup share folder in our QNAP that you want to rsync from your freenas
for ex : Freenas
View attachment 40172


2. setup your rsync server on your QNAP from menu “ Backup Station “ like below :

View attachment 40173

make sure that username and password that you’re using, same as with username in freenas that you will going to rsync

Freenas site :

  1. create account with username and password same as username password in QNAP ( look point 2 )
  2. set this account full access to the dataset that you want to rsync
  3. create new folder for store file for password that you will use for the username :
  • touch /mnt/Data/passwordlocationstore/rsync.pwd
  • just write only and only your password in that file ex : password
4. set the user account that you will use for rsync full access that folder “passwordlocationstore” .

5. create rsync task in freenas like below :


View attachment 40174




View attachment 40175

extra option is : where the password file located (point no.3)



6. End ( you can test run rsync to make sure it’s running )


Regards,

I have an issue when run job:

The --password-file option may only be used when accessing an rsync daemon.
rsync error: syntax or usage error (code 1) at main.c(1395) [Receiver=3.1.3]

thanks
 
Joined
May 13, 2021
Messages
22
i've got the solutions for rsync from freenas to qnap :


Freenas site :

  1. create account with username and password same as username password in QNAP ( look point 2 )
  2. set this account full access to the dataset that you want to rsync
  3. create new folder for store file for password that you will use for the username :
  • touch /mnt/Data/passwordlocationstore/rsync.pwd
  • just write only and only your password in that file ex : password
4. set the user account that you will use for rsync full access that folder “passwordlocationstore” .

i'm confused.

- how do i go to or create this /mnt/Data/passwordlocationstore/rsync.pwd file and the folder location it is at??
- so i just put the password in plain txt format? that's all? is that secure to do?
- how do i set the user account for rsync full access to that "passwordlocationstore" folder?

- i use a created user called admin for my datasets. this is what i use to login from windows 10 to browse my shares using file explorer. But if i create this other account for rsync (lets call this user qnaprsync), then make it the owner for the dataset, then does that mean i cannot login to admin user account and access r/w my files using smb on windows 10 file explorer anymore? sorry i'm newb but how does this work. Is it possible for multiple users to have access to r/w to the same dataset? how do i do this
 

FosCo

Dabbler
Joined
Sep 20, 2020
Messages
23
The command to create is shown with touch.
Then use vi or something and yes, plaintext.
User with chown. Access rights with chmod, should be 600 to be secure, rsync would probably complain otherwise.
User for rsync should be different setting in qnap afair.
 
Joined
May 13, 2021
Messages
22
i have no clue about vi chown etc.

instead i used winscp to login as root (had to enable ssh for root user), then i browsed to a folder i created a home for my rsync user, then i created the pwd file, then added the password in it, then in rsync task added the extra command as advised. added the rsync module pointing to the sharename on the qnap

i'm assuming it's "share" without quotes, and not "/share/CACHEDEV2_DATA/share" ya?

it didn't work.

i created the rsync server on both truenas and qnap qts both match username and password credentials. added permission rights for both to their respective folders. but doesn't work.
 

FosCo

Dabbler
Joined
Sep 20, 2020
Messages
23
i have no clue about vi chown etc.

instead i used winscp to login as root (had to enable ssh for root user), then i browsed to a folder i created a home for my rsync user, then i created the pwd file, then added the password in it, then in rsync task added the extra command as advised. added the rsync module pointing to the sharename on the qnap

i'm assuming it's "share" without quotes, and not "/share/CACHEDEV2_DATA/share" ya?

it didn't work.

i created the rsync server on both truenas and qnap qts both match username and password credentials. added permission rights for both to their respective folders. but doesn't work.
What's the log telling you?
You probably could change permissions and owner with winscp, too. Switch user and group to your truenas uid/gid of the wrap user you created on truenas and which should run the job.
Change permissions of the file to read only by owner (one checkbox upper left corner of the 9 or 12 checkboxes).

And watch the log please.
 
Top