Synology to FreeNAS RSync

Status
Not open for further replies.

Brian Seng

Cadet
Joined
Apr 13, 2016
Messages
2
Hello all,

First, I sincerely apologize, I have been hitting the google and trolling these forums (search function included) and have failed to find resolution to my issue. If anyone could correct my lapse in basic troubleshooting skills I would sincerely appreciate it. On a second note though, been reading these forums without posting for along time. This community is impressive in its support and knowledge of FreeNAS and has aided me in building one of my most prized pieces of hardware.

I own a Synology DS415+ running DSM 6.0. Synology supports backup to RSync compatible servers, however when setting up despite having a pull task module configured it states backup destination does not exist. The Synology runs my primary Plex media server and some other things, and aside from running my virtual machine lab in vdevs I use my FreeNAS box for cold storage backups of the Synology. I would greatly like to setup an RSync task to copy over rather than every week or two remembering "oh crap, time to copy over." Much as I like that Synology, its not too great for copying to network targets....

Does anyone have or know of and could point me at a set of instructions for my needed setup? Again I sincerely apologize for being "that guy" on this one. Did not want my first post here to be like that.
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
I used to have a Synology. For rsync to work correctly with FreeNAS, I had to enable the rsync custom configuration option in DSM, then use SSH to edit /etc/rsync.conf (I believe) for customisation. There is a KB document on the Synology web site on how to do this. Unfortunately I don't remember the settings I used.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I have an old Synology DS411+II running DSM 5.2-5644 Update 8.

I use rsync to push and pull data between it and my FreeNAS 9.3 machines, though I don't use the Synology Backup w/ Destination approach -- I just use scripts. This give me finer control over how datasets are copied.

It's been a while since I set this up... but I think the key thing is to get SSH working between FreeNAS and the Synology. You'll need to enable it on both ends, set up keys for logging on without a password, etc. There are plenty of how-to's on doing this.

Besides enabling SSH on the Synology, I also turned on the network backup service on the 'Backup Services' panel under 'Backup & Replication':
syno-backup-services.jpg


All you need to do on the FreeNAS side is enable the rsync service under 'Services'.

My Synology is named 'betrand', so I wrote a script named 'rsync-pull-from-bertrand.sh', stored in my 'system admin' dataset (/mnt/tank/sysadmin):

Code:
#!/bin/sh

# Copy shared folder from Synology system 'bertrand' to FreeNAS system
#
# 'source' = shared folder name on 'bertrand'. These are assumed to live on
#   'volume1'; modify R_SRC setting below to suit your environment's server
#   and volume names.
#
# 'target' = dataset on FreeNAS system. These are assumed to live in a pool
#   named 'tank'; modify R_DEST below if needed.
#
# NB: WARNING! Study the various RSYNC_OPTS settings below! The current active
#   selection below uses the '--delete-during' flag, which syncs the target to the
#   source, deleting any folders/files on the target that don't exist on the source.
#   This may not be what you want.

if [ $# -lt 2 ]
then
  echo "$0: not enough arguments"
  echo "Need source target datasets"
  exit 2
fi

if [ $# -gt 2 ]
then
  echo "$0: too many arguments"
  echo "Need source target datasets"
  exit 2
fi

# This script logs results to a log file in /mnt/tank/sysadmin - modify to suit your environment:

R_LOGFILE="/mnt/tank/sysadmin/rsync-pull-from-bertrand.log"

# rsync options: study these and choose whichever suits your needs:

RSYNC_OPTS="-rltgoDhv --delete-during --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db --inplace --log-file="${R_LOGFILE}
# RSYNC_OPTS="-rltgoDhv --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db --inplace --log-file="${R_LOGFILE}
# RSYNC_OPTS="-ahv --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db --inplace --log-file="${R_LOGFILE}
# RSYNC_OPTS="-ahv --inplace --log-file="${R_LOGFILE}

R_SRC=/volume1/$1/
R_DEST=/mnt/tank/$2

echo "Pull" ${R_SRC} "to" ${R_DEST} "from BERTRAND" >> ${R_LOGFILE}

set -x
rsync ${RSYNC_OPTS} root@bertrand:${R_SRC} ${R_DEST}


I call this script from a shell script to copy Synology shared folders to datasets of the same name on my FreeNAS system, like this:

Code:
#!/bin/sh

cd /mnt/tank/sysadmin

./rsync-pull-from-bertrand.sh archives archives
./rsync-pull-from-bertrand.sh atm atm
./rsync-pull-from-bertrand.sh backups backups
./rsync-pull-from-bertrand.sh devtools devtools
./rsync-pull-from-bertrand.sh hardware hardware


I call the 'pull-from-bertrand.sh' script from a chron job, like this:
fn-chron-jobs.jpg

Hope this helps and is enough to get you started. Good luck!
 

Brian Seng

Cadet
Joined
Apr 13, 2016
Messages
2
Thank you both very much. Was a bit more than I expected, but presently working to implement. First glance somewhat intimidating, but overall makes plenty of sense in your approach. Will post back when I get this running!
 
Status
Not open for further replies.
Top