What's new

Rsync backup server

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

dciarnie

Occasional Visitor
Hi,

I just picked up an RT-AC68U and flashed it with the Merlin firmware. I would like to use the router as an rsync backup server similarly to that described in http://www.dd-wrt.com/wiki/index.php/Rsync_Backup_Server for a dd-wrt router.

Being very new to asuswrt-merlin routers, I am uncertain as to how to transcribe the dd-wrt instructions into something suitable for asus. So, the question is, once I've installed rsync, how do I configure an rsync daemon on the router?

Any help would be greatly appreciated.
 
Ok. I wasn't sure because the existence of the various user scripts (e. g. services-start, post-mount) made me think that one might have to configure things slightly differently on merlin. I'll give it a whirl and see what happens.
 
Finally got this installed and working. The dd-wrt instructions work for Optware but not quite for Entware since the rsync package in Optware includes everything including the daemon scripts while Entware has separated the daemon scripts into their own package, rsyncd.

Once I installed both rsync and rsyncd, I was able to configure the daemon like I would on any other system; no need to use the dd-wrt instructions.
 
Sure, not a problem.
  1. Install entware, if you haven't already done so, with entware-setup.sh
  2. Install rsync and rsyncd: opkg rsync rsyncd
  3. Configure rsync daemon
    • You don't have to stick to the dd-wrt instructions for this as the standard configuration works (I used http://everythinglinux.org/rsync/ as a starting point). The only caveat is that the configuration files are in /opt/etc, not /etc.
    • Make sure that the secrets file is read/writable only by the owner (i. e. chmod 600 /opt/etc/rsyncd.secrets).
  4. Start the daemon with /opt/etc/S50rsyncd start
Here's my configuration:

/opt/etc/rsyncd.conf
Code:
# /etc/rsyncd.conf
# Next line required for init script
pid file = /opt/var/run/rsyncd.pid
log file = /opt/var/log/rsyncd.log
use chroot = yes
uid = admin
gid = root
read only = yes
secrets file = /opt/etc/rsyncd.secrets

[backup]
path = <path>/<to>/<target>/<directory
read only = no
auth users = user1

/opt/etc/rsyncd.secrets
Code:
user1:user1password

I backup files from my Linux box with this command:
Code:
rsync -rlptgoq --delete --update --exclude-from=/root/scripts/excludes --password-file=<passwdfile> / user1@192.168.1.1::backup
As with rsyncd.secrets, passwdfile must also be read/writable only by the owner.

Hope this helps.
 
Installing the daemon isn't necessary if you have SSH access set up. You can use the -e option to rsync to tunnel rsync through SSH. Something like this would work

Code:
rsync -e ssh local_file user@router.asus.com:/path/to/remote

Basic rsync does need to be installed on the router, though.
 
Okay, thanks. I was able to run rsync smoothly, but I it shows no progress on it. I use this command:

Code:
rsync -e --progress --inplace --rsh='ssh -p29' fold user@192.168.1.1:/mnt/data/backup/folder

Maybe with daemon it will run properly?

Also they say daemon is more efficient on big data which is my case (100Gb+)
 
I think that your problem is that you're passing -e (without a shell command) and --rsh, so that might be causing a conflict. Try leaving out the -e.

If most of your data doesn't change between backups, then speed is mostly an issue the first time you back up.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top