DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-10-08 10:30:15

maestro
New member
Registered: 2009-10-08
Posts: 4

how to rsync to another DNS 323?

hi

Am trying to figure out how to do a backup of my DNS 323 by using rsync to copy data from my main NAS to another one after installing ffp.  Also intend to schedule daily via cron job.

Anyone can contribute some commands to do it as I am a linux newbie and trying to read all the instructions but can't get it right.  sad  I did see the rsync commands from Volume_1 to Volume_2, trying to adapt that across 2 NAS.

As far as I understand I have to run rsync in daemon mode on one (or more) of the NAS.  I concluded I do not need to mount any smb drive (not going via smb protocol) and also SSH is optional.  Anyone done this appreciate if you could share your command lines and I can adapt from there.

Many thanks in advance.

Last edited by maestro (2009-10-08 10:32:45)

Offline

 

#2 2009-10-08 14:36:46

zeroday
Member
Registered: 2007-07-01
Posts: 136
Website

Re: how to rsync to another DNS 323?

I use this on the source

/mnt/HD_a2/ffp/start # more rsyncd.sh
#!/ffp/bin/sh

# PROVIDE: rsyncd
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr

name="rsyncd"
command="/ffp/bin/rsync"
rsync_flags="--daemon --config=/ffp/etc/rsyncd.conf"
required_files="/ffp/etc/rsyncd.conf"

run_rc_command "$1"


/ffp/etc/rsyncd.conf

uid = root
gid = root
port = 5000

secrets file = /mnt/HD_a2/ffp/etc/rsyncd.secrets
strict modes = false

/ffp/etc/rsyncd.secrets file
username:password
[vol1]
    path = /mnt/HD_a2
        read only = no

[vol2]
    path = /mnt/HD_b2
        read only = no

on target

/mnt/HD_a2/ffp/start # more editcron.sh
#!/ffp/bin/sh

CRONTXT=/mnt/HD_a2/crontab.txt

# start with existing crontab
/bin/crontab -l > $CRONTXT

# add the Rsync job to execute at 2:05 am - also create a logfile (append to any existing log file)
# note: use a single > after /mnt/HD_b2 if you want to a create a new log file each night with no append
/bin/echo "5 2 * * * /mnt/HD_a2/ffp/bin/rsync --port=5000 --force --ignore-errors --delete --exclude=/ffp/start/editcron.sh -avP 192.168.1.51::vol1 /mnt/HD_a2" >> $CRONTXT
/bin/echo "5 14 * * * /mnt/HD_a2/ffp/bin/rsync --port=5000 --force --ignore-errors --delete -avP 192.168.1.51::vol2 /mnt/HD_b2" >> $CRONTXT

# install the new crontab
/bin/crontab $CRONTXT

# clean up
/bin/rm $CRONTXT


I think that this can do the job (cause it does it here daily)

Offline

 

#3 2009-10-09 02:41:02

maestro
New member
Registered: 2009-10-08
Posts: 4

Re: how to rsync to another DNS 323?

wow. thanks!  i had expected a couple of lines, this is quite complex i must say.  I'll try to interpret it, simplify it and give it a try for sure!

Offline

 

#4 2009-10-09 12:43:46

zeroday
Member
Registered: 2007-07-01
Posts: 136
Website

Re: how to rsync to another DNS 323?

my version has already removed a lot of 'code' so if it can be even more simpler I would be a little surprised ;-)

Offline

 

#5 2009-10-09 13:27:49

maestro
New member
Registered: 2009-10-08
Posts: 4

Re: how to rsync to another DNS 323?

Ok I'm no expert here so will try to digest everything.  Problem is I dun understand every line to adapt it.

Last edited by maestro (2009-10-09 13:40:18)

Offline

 

#6 2009-10-12 03:13:58

Truedeek
Member
Registered: 2009-01-28
Posts: 10

Re: how to rsync to another DNS 323?

This what I use based on 2 of my DNS323's.  I have it in a sh file within my Start folder in FFP, it works and I really don't know much about linux.  I took most of it from another backup post on this site (Thanks Chumby!!! http://dns323.kood.org/forum/viewtopic.php?id=1150 ).  The mounting is based on mounting to an open share on the other dns323.  This runs on each start up and sets up to run every night copying all my pictures to the other dns323.  When I upgrade ffp I just copy the sh file over to the new start folder. It also writes a log.

mkdir /mnt/data
mount 192.168.71.151:/mnt/HD_a2/sync /mnt/data
mkdir /mnt/Media
mount 192.168.71.151:/mnt/HD_b2/Media /mnt/Media
CRONTXT=/mnt/HD_a2/crontab.txt
/bin/crontab -l > $CRONTXT
/bin/echo "5 2 * * * rsync -avrb --delete-after /mnt/HD_b2/Pictures/* /mnt/data > /mnt/HD_a2/ffp/log/rsync.last.log" >> $CRONTXT
/bin/crontab $CRONTXT
/bin/rm $CRONTXT

Not too simple I hope... smile

TrueDeek.

Last edited by Truedeek (2009-10-12 03:39:16)

Offline

 

#7 2009-10-21 14:03:11

maestro
New member
Registered: 2009-10-08
Posts: 4

Re: how to rsync to another DNS 323?

Hmmm.. Thanks. I'll try this, much simpler.  What do you mean by "open share"?  I can see the share via \\NASname\Share but get an error when i execute the mount command??

Last edited by maestro (2009-10-21 22:12:40)

Offline

 

#8 2009-10-26 13:10:14

Truedeek
Member
Registered: 2009-01-28
Posts: 10

Re: how to rsync to another DNS 323?

maestro:

I have no passwords on any part of the DNS323 so I didn't need any on the shares.  Make sure that you actually create the dir's prior to attempting to mount and then it works, without this it never worked for me.

mkdir /mnt/data
mount 192.168.71.151:/mnt/HD_a2/sync /mnt/data

The shares were setup for all groups:
Share|Path               |User/Group|Comment|Oplocks|Maparchive|R/W|
sync |Volume_1/sync|ALL            |              |yes      |yes            |Yes|


TrueDeek.

Offline

 

#9 2009-10-26 19:25:57

qryptiq
Member
From: New Ro
Registered: 2009-03-10
Posts: 49

Re: how to rsync to another DNS 323?

this is great - i just purchased a second unit and was wondering about sync'ing possibilities between two units.

thank you all.


~~~~~~~~~~~~~~~~~~~
DNS-321, 2x1.5tb Barracudas

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB