Jump to content

is it possible to sync unraid to a synology DS414?


Recommended Posts

Hi,

 

I've just bought a Synology DS414 for my data files, Time machine, PC backups etc, so my unraid HP N40L can just act as a media server, with all my plugins running.  My unraid server currently has 3Tb of data, and the new Synology has 8.7Tb of free spare, so plenty of room to back up the unraid box.

 

I was hoping to backup the unraid server to the synology hopefully with an automated sync plugin or something so that I don't have to run it via a PC and maybe schedule it for nighttime.  I'm not sure if running the sync from unraid is best or seeing if synology has a plugin to do it.

 

Any help is appreciated.

Link to comment

unRAID has the rsync client. You can also enable unRAID as an rsync server.

If the synology supports rsync as a client or server then you can use which ever machine you want to either pull or push the data.

 

If not, then find out which machine has the ability to create cron jobs the easiest.

Which ever one works for you, mount the other machine via SMB or NFS to copy the data.

 

I don't know enough about the synology to help you more then that.

 

I know my readNAS had the ability to schedule rsync client jobs from a webGui.

 

However if it's easier to configure the synology to be the rsync server, a simple command line in a crontable can be set up on the unRAID client.

Link to comment

Thanks WeeboTech. :)

 

I've googled rsync a bit and I assume from what I've read it's all command line based.  The synology box seems to be able to act as a rsync client or a rsync server.

 

Am I right is thinking that the server syncs to the client?

 

Is there a GUI for this stuff or a "how to" to get me started on rsync for unraid?  I know a bit of linux, and I'm learning but I'm no guru.

 

Ultimately I want unraid to be the original because I have no intention of playing with my plugins which is all working fantastically.  The Synology is just going to be a backup copy.  It will also host backups from my PCs/Mac and some documents that I can access via the web using Synology's cloud software and apps.  For this it should work well I think, and the read write speeds are better for accessing and backing up.

 

I'm happy with my unraid server, so don't think I'm leaving, it's the best system for handling my media collection.  I'm actually about to buy a licence after being a "freeloader", so I can expand to a few extra drives and get user capability (not sure if I need that for rsync or not). :)

Link to comment

There's no gui for rsync on unRAID. I can aid with configurations and scripting ideas.

 

 

Check the synology for a gui, once you give me an idea of what's available it might be easier.

It's pretty easy to set up the rsync server on unRAID with a few config files and rsync commands in the /boot/config/go script.

 

 

The synology can then pull the files if there is a client gui with some kind of scheduler.

Link to comment

This explains how to set up the Synology as a destination server (to receive backup?) and below that how to backup via rsync to my unraid box. https://www.synology.com/en-us/knowledgebase/tutorials/461#t3

 

Question, can I do both?  So say sync my media to the synology to back it up, and do the reverse to backup the synology to the unraid or is that not advisable?

 

I've just had 2 drives start failing on my PC so I'm keep to sync these two and then also have a backup of all my other data again via USB drive, and another online.  OCD maybe, but it will be photos and my business/personal documents that I'll be backing up to 3 to 4 separated locations.

Link to comment

Here is my rsyncd.conf file.

I store it on the flash in /boot/local/etc/rsyncd.conf.

I rsync it to /etc/rsyncd.conf in the go script.

 

/boot/local/etc/rsyncd.conf

uid             = root
gid             = root
use chroot      = no
max connections = 4
timeout         = 600
pid file        = /var/run/rsyncd.pid
log file        = /var/log/rsyncd.log
socket options  = SO_SNDBUF=524288,SO_RCVBUF=524288

[mnt]
        path = /mnt
        comment = /mnt files
        read only = FALSE
        list      = yes

[boot]
        path      = /boot
        comment   = /boot files
        read only = FALSE
        list      = yes

[home]
        path      = /home  
        comment   = HOME USERDIR Files
        read only = FALSE
        list      = yes

[backup]
        path      = /mnt/disk1/backup  
        comment   = /mnt muthu files    
        read only = FALSE
        list      = yes

[Video]
        path      = /mnt/user/Video  
        comment   = Video Files
        read only = FALSE
        list      = yes

[Music]
        path      = /mnt/user/Music  
        comment   = Music Files
        read only = FALSE
        list      = yes

[images]
        path      = /mnt/user/Images  
        comment   = Image Files
        read only = FALSE
        list      = yes

 

Here is my rc.rsyncd script.

I put it in /boot/local/etc/rc.d/rc.rsyncd.

I call it in the go script.

actually, I rsync it to /etc/rc.d, then call it as /etc/rc.d/rc.rsyncd start.

 

/boot/local/etc/rc.d/rc.rsyncd

#!/bin/sh
# Start/stop/restart rsyncd

# Start rsync:
rsync_start() {
  rsync /boot/local/etc/rsyncd.conf /etc/rsyncd.conf 

  if [ -x /usr/sbin/rsync ]; then
     echo "Starting rsync daemon:  /usr/sbin/rsync"
     /usr/sbin/rsync --daemon
     return
  fi

  if ! grep ^rsync /etc/inetd.conf > /dev/null ; then
  cat <<-EOF >> /etc/inetd.conf
rsync   stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/bin/rsync --daemon
EOF
  kill -1 $(</var/run/inetd.pid)
  fi

}

# Stop rsync:
rsync_stop() {
  killall rsync
  rsync /etc/rsyncd.conf /boot/local/etc/rsyncd.conf
}

# Restart rsync:
rsync_restart() {
  rsync_stop
  sleep 1
  rsync_start
}

case "$1" in
'start')
  rsync_start
  ;;
'stop')
  rsync_stop
  ;;
'restart')
  rsync_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

 

here's a snippet of my go script.

keep in mind I have other things I do and start in my go script that you will need to comment out.

I left them here for the user example.

 

For example anything that needs to remain persistant on shutdown, I always copy from /etc to /boot/local/etc

this way it gets rsynced on start up.

 

rsync -a /boot/local/etc /etc

while read SCRIPT 
do    [ -z "${SCRIPT%\#*}" ] && continue 
      [ -x "$(SCRIPT)"     ] && ${SCRIPT}
done <<-EOF
/boot/local/etc/rc.d/init.d/rc.installpkg
# /boot/local/etc/rc.d/rc.parity start
/boot/local/etc/rc.d/rc.rsyncd start
/etc/rc.d/rc.sshd start
EOF

Link to comment

Thanks WeeboTech,

 

I had a little play with rsync but couldn't quite figure it out, so for now I've mounted the unraid share on the diskstation, and set up a scheduled backup to pull the data across.  That seems to be working and can be incrementally updated. :)  And it has a gui as a bonus.

 

I'll persevere with rsync because it's more customisable but I'll have to do a bit more reading about connecting across a network.

Link to comment

I have a shell script you can use as a model on the unRAID server.

https://code.google.com/p/unraid-weebotech/downloads/detail?name=rsync_linked_backup

 

It's purpose is to backup one folder to another 'dated' version.

This allows you to keep a rolling backup dated set of files that takes 1x the amount of space plus the amount of space per change.

 

You can have it daily, hourly, weekly or monthly depending on how you define the output directory name which is date macro specific.

 

i.e.

%Y%m%d is daily

%Y-%U is weekly (even if you run it daily)

%Y%m is monthly.

 

It has to 'pull' the data for now. However you can have a specific backup drive that can be added/removed on some type of schedule.

 

 

The script can be a little daunting or intimidating for the novice which is why I do not publish it as such a tool.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...