rsync not working on TrueNAS core 12 - works on FreeNAS-11.3-U5

mudflap

Cadet
Joined
Jul 6, 2021
Messages
1
Long time user of freenas here. First time having to post for information.
Can not seem to get rsync to work on TrueNAS core 12. This is from any *nix box to TrueNAS using rsync named module.
I have 2 FreeNAS-11.3-U5 machines running fine. I set up a new FreeNAS-11.3-U5. Confirmed everything hardware wise worked. Set everything up like the other 2 boxes. I then did the upgrade to TrueNAS core. I tried to use rsync from Ubuntu 18.04, Linux Mint, and FreeBSD 12. I get the same error of:
Code:
rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.2]

I triple checked all settings were the same between FreeNAS and TrueNAS.
I reinstalled from scratch FreeNAS-11.3-U5 onto it and rsync works fine. Is this a bug I need to file or did something change that I am unaware of?
rsync command that works on FreeNAS and not on TrueNAS:
Code:
rsync -az --no-g --no-perms --omit-dir-times -O --exclude-from '/home/XXXX/rsync_excludeme.txt' / nas003.XXXXXX.XXX::vhost004

Machine in question (even though I dodn't think it matters)
Dell r720
H310 mini (IT mode)
7 SAS drives in raidz2
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I've had success with rsync modules on TrueNAS 12.0, using the explicit rsync: syntax with a user specifier, like this (for module 'systems' on TrueNAS 12.0 server 'BACON'):
Code:
rsync ${R_OPTIONS} ${R_EXCLUDE} ${R_SRC} rsync://root@bacon/systems


See my 'scripts for using rsync' GitHub repository for examples and details:

 

djb

Explorer
Joined
Nov 15, 2019
Messages
76
i'm trying to Rsync over SSH from Truenas to Synology.
can i run the command from Truenas shell ? i got an error command not found.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Depending on your environment you might have to use /usr/local/bin/rsync.
 

djb

Explorer
Joined
Nov 15, 2019
Messages
76
/usr/local/bin/rsync.

thanks for your tip. i'm in truenas shell doing:

$ rsync --rsync-path=/usr/local/bin/rsync -avzx /rsync_test truenazz@192.168.3.119:/volume1/NetBackup/truenascube

and

$ rsync --rsync-path=/usr/bin/rsync -avzx /rsync_test truenazz@192.168.3.119:/volume1/NetBackup/truenascube

both cases giving command not found.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
--rsync-path is for the path to the rsync binary on the remote system. Probably your Synology. Try not to specify that at all, first. And replace the initial rsync with /usr/local/bin/rsync as I said.
 

djb

Explorer
Joined
Nov 15, 2019
Messages
76
--rsync-path is for the path to the rsync binary on the remote system. Probably your Synology. Try not to specify that at all, first. And replace the initial rsync with /usr/local/bin/rsync as I said.

i have followed your suggestion as below:

$ /usr/local/bin/rsync -avzx /rsync_test truenazz@192.168.3.119:/volume1/NetBackup/truenascube

$ /usr/bin/rsync -avzx /rsync_test truenazz@192.168.3.119:/volume1/NetBackup/truenascube

same error.

1630754699355.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Why are you typing a $ at the beginning of that command line? The shell is complaining that it cannot find the "$" command - which is perfectly correct. :wink:
 
  • Like
Reactions: djb

djb

Explorer
Joined
Nov 15, 2019
Messages
76
Why are you typing a $ at the beginning of that command line? The shell is complaining that it cannot find the "$" command - which is perfectly correct. :wink:

That's great.. coming from windows i start liking those things a lot.
this command works for me:

rsync -avzx /mnt/MirrorPool/rsync_test truenazz@192.168.3.119:/volume1/NetBackup

is there any way to automate it with cron ? if i run manually through shell, it ask for a password and then is executing.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
That's great.. coming from windows i start liking those things a lot.
this command works for me:

rsync -avzx /mnt/MirrorPool/rsync_test truenazz@192.168.3.119:/volume1/NetBackup

is there any way to automate it with cron ? if i run manually through shell, it ask for a password and then is executing.
To avoid having to enter a password, you will need to set up SSH key authentication for the truenazz user account on your Synology. Here is a pretty good tutorial:


I have a GitHub repository with some rsync scripts that you may find useful:

 
Top