How to RSYNC from TrueNAS to a SMB Share using Module

Hi Forum, seems things are overcomplicated - at least for me - so i kindly ask for help.

GOAL: RSYNC Data from TrueNasFolder to a SMB Share

Using the module i can configure a SMB Share however i dont know how to configure it to PUSH data to it.

Any pointers are welcome

Did you check this doc out?

Push vs Pull are set in the direction field

but how do i specify the SMB Share as a Target Location?

If you’ve already configured an rsync module to the location you want to target, you just need to create a task to push to it:

its still not clear how to configure the module.

1.) Do i need to enable the module? as i would specify the same host path again as in the rsync task … which wouldnt make sense

Or can this remain be disabled as i only need the SMB Share?

Which i configured as follows

edit: so i just got the error stating

At least one module must be configured and enabled

So in that case i guess the rsync module is not meant to push from local TrueNas to foreign SMB Client

edit: so just for testing, i enabled the module and created a rsync task using the current TrueNas IP ( as remote )

However, i will run into

rsync: [sender] failed to connect to 192.xxx.xxx.xxx (192.xxx.xxx.xxx): Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(139) [sender=3.2.7]

You would need to use Rsync to do a “local” transfer, which is not supported in TrueNAS, unless you do it manually with the command-line.

There was a feature request for this, I think.

1 Like

i raised that FR in Rsync Task should allow local 2 local synchronisation ( Local Destination Target ) - Feature Requests - TrueNAS Community Forums

But your comment gave me the correct idea. I’ve mounted the SAMBA Share via CLI and will do rsync test

truenas_admin@truenas[~]$sudo mount -t cifs -o username=‘user’,password=‘password’,domain=WORKGROUP //192.168.178.56/TN-Sync-4TB /mnt/smb

truenas_admin@truenas[~]$ sudo rsync -rh /mnt/WD8TB/BACKUP /mnt/smb --ignore-existing --delete --info=progress2
227.10M 1% 1.05GB/s 0:00:00 (xfr#1, ir-chk=1058/1082)

another observation that i am running with hgih CPU Utilisation. Any idea how to relax CPU … it seems the whole systme locks up

I couldn’t figure out how to configure Rsync Task to rsync between 2 datasets on same NAS or NAS → SMB share. I don’t think it’s supported via Rsync Tasks.

What I do is I run a cronjob that basically invokes rsync command.

1 Like

@bugacha doing the same manually on CLI. Can you please show me how to create a cron for this.

Also do you use any specific Flags for SMB?

this is a job for local dataset sync

rsync -avhz --progress --inplace --delete /mnt/volume3/photos /mnt/volume1/

for SMB remote, I usually mount via something file this :

//nas3/photos /mnt/photos cifs credentials=/etc/smbcredentials,vers=3.0,_netdev,soft,nofail,noatime,actimeo=1800 0 0

1 Like

great thanks. i’ll give this a try. the issue with my CPU Load seems to be related to SMB Oplocks which is disabeld on the target and now it doesnt lock up nor consume lots of CPU

@bugacha can i somehow monitor the rsync process when using cron?

you can output stdout into a log file and tail it

Hello community,
I am new with TrueNAS (I am using TrueNAS 25.04.1). I want to migrate my movies from my old NAS to the new one. I tried to do the same operation the opposite direction: pull data from remote SMB share to TrueNAS. But TrueNAS systematically crashes and reboots every time.
I can mount the remote SMB share via CLI the same way you suggest:

truenas_admin@truenas[~]$sudo mount -t cifs -o username=‘myuser’,password=‘mypassword’,domain=WORKGROUP,vers=1.0 //192.168.x.y/Media /mnt/smb

I only need to add vers=1.0 because my old NAS is … quite old.
I can also run rsync with same options and switching src and dst paths so that I get a pull behavior:

truenas_admin@truenas[~]$ sudo rsync -rh /mnt/smb/Movies /mnt/streaming-pool/Media --ignore-existing --delete --info=progress2

The process starts, I can see some progress, then the system hangs and reboots without any apparent reason.

I cannot understand what’s wrong with it. Any idea? Shall I create a new topic for that?

Many thanks

HI @hArt1g4n I am also relatively new - I would recommend starting a new post since this looks like a different issue than OP.

In the meantime, just wondering: is it possible to, instead of mounting SMB share, to use SSH (or even rsync module) to connect to remote NAS? It would seem cleaner since you wouldn’t be using rsync on top of SMB.

Not sure if this is related, but I had a different (not rsync) use case that needed to connect from TrueNAS to remote SMBv1 share and had to give up because the behavior was atrocious - TrueNAS ended up creating new processes for every access and not terminating the processes, so RAM was being chewed up like crazy—I never saw a reboot, but certainly OOM forced killing of a bunch of apps to try to recover, in summary, a mess. No amount of tinkering with settings fixed the problem, so I ended up switching to NFS.