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.

#26 2007-12-27 03:59:21

redmodel
Member
Registered: 2007-11-17
Posts: 8

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Hi,

Thanks for the guide, it's really helpful.  But, I am wondering if anyone can help me to apply the exact same method to syncing a folder on a local computer to the DNS.

I tried to modify the code, but it seems like ssh is needed.  and my local computer would be "192.168.xx.xx:/userdata" in the rsync command line, and this is the error I get:  I didn't put a user in front of the source folder.  Not sure if one was needed.

rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(86) [receiver=2.6.9]
rsync: writefd_unbuffered failed to write 4 bytes [receiver]: Broken pipe (32)
rsync error: error in IPC code (code 14) at io.c(1122) [receiver=2.6.9]

Last edited by redmodel (2007-12-27 04:00:50)

Offline

 

#27 2007-12-27 15:14:54

bgoedel
Member
From: Vienna, Austria
Registered: 2007-11-24
Posts: 62

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I also had a lot of trouble getting rsync for Windows running. I downloaded cwRsync but it seems to need Cygwin to run properly. I tried to use rsync like this from the command line in Windows:

Code:

rsync -Dlrtpv --delete e:\data p:\backup

where e:\ is my local harddisk and p:\ is the Samba share of the NAS. It didn't work because rsync obviously assumes that locations containing a ":" are remote. As not both, source and target can be remote locations, it failed doing the sync.

At last I wrote a small Python script doing similar work. Of course, it is not capable of doing all the stuff rsync can do and it is also not that band width efficient but it simply copies newer files from SRC to DST and removes files from DST that have been deleted on SRC. I use it als GroupPolicy / Logoff Script on Windows to back up all modified files to the NAS when logging off or switching off the computer.

If you're interested, its in the attachment.

Bernhard

Last edited by bgoedel (2007-12-27 16:17:46)


Attachments:
Attachment Icon file-sync.py, Size: 2,731 bytes, Downloads: 830

Offline

 

#28 2007-12-28 02:48:36

redmodel
Member
Registered: 2007-11-17
Posts: 8

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Okay, i gave up on getting the rsync client on the DNS to connect to my local computer to do backup...

I just enabled the Rsync Server on the DNS and added a user:pass to the rsyncd.secret file

Then, I installed this on my computer:

http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp

Only ran the client, and it successfully found the Rsync Server on the DNS, and now syncing works perfectly.  DeltaCopy works very well with Windows Scheduler.  Of course, i would have liked the DNS to do all the work, but DeltaCopy runs nicely in the background.. not a big deal, and has a GUI.

Last edited by redmodel (2007-12-28 02:50:03)

Offline

 

#29 2007-12-28 19:18:21

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I wrote a set of scripts to do what you're talking about--where the DNS-323 does all the work to do the backups.  It's available at http://backupnetclone.sourceforge.net/  The files are there, but I don't have installation instructions yet.  Not sure when I'll get the instructions up, but the basics are there.

Offline

 

#30 2008-01-05 10:22:32

ambanmba
Member
Registered: 2008-01-05
Posts: 5
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby,

Thanks for this - it's fantastic. A much safer alternative than RAID1 for those who sometimes "SAVE" instead of "SAVE AS" smile

I recently upgraded from a Linksys NSLU2 (a.k.a. SLUG) which had a built-in feature exactly like this... every day at XX it would copy one drive to another. The SLUG would also e-mail me to confirm that everything went OK.

Is there a way we could add such a feature to this script? Potentially using something like esmtp?

Thanks,

ambanmba

Offline

 

#31 2008-01-07 14:33:45

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I tried to create a file like described in step 3, but i get a warning that this file cannot be created.
I can create the file in another directory on my computer or in the root of volume 1 but then copying it to the specified folder is also impossible. The warning tells me i have no permission to the folder. Also with ftp i can't get the file in the right folder.

Offline

 

#32 2008-01-08 09:29:41

Chumby
Member
From: Tasmania, Australia
Registered: 2007-08-01
Posts: 96
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

knireis - no idea why that is happening.  Can you reset the dns (either via the web-interface) or the hard boot via the pin hole at the back and then try to copy the file in?

Cheers
Chumby

Offline

 

#33 2008-01-08 09:32:52

Chumby
Member
From: Tasmania, Australia
Registered: 2007-08-01
Posts: 96
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Anbanmba - Great to see it is working well for you.  I noticed blbrown had some code (search for "email") in these forums that may be adapted.  Perhaps get an email sent to you "saying the job has finished" and then having the log file which has been created sent as an attachment?

blbrown - Do you see this as a possibility for the email script you have created?

Cheers,
Chumby.

Offline

 

#34 2008-01-08 10:19:16

ambanmba
Member
Registered: 2008-01-05
Posts: 5
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby wrote:

I noticed blbrown had some code (search for "email") in these forums that may be adapted.  Perhaps get an email sent to you "saying the job has finished" and then having the log file which has been created sent as an attachment?

Thanks for that... it looks like the post you are referring to is this one:

http://dns323.kood.org/forum/p7404-2007 … html#p7404

ambanmba

Offline

 

#35 2008-01-08 12:51:10

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby wrote:

knireis - no idea why that is happening.  Can you reset the dns (either via the web-interface) or the hard boot via the pin hole at the back and then try to copy the file in?

Cheers
Chumby

I did the reset both ways, but no luck. I renamed the fun_plug.d folder and installed the funplug .3 again but again the same thing. Also i am not able to delete the renamed (fun_plug.d-old) folder, any idea how to do this? How do i remove the funplug completely and delete all the folders created by the funplug? I can then try again from a fresh start.

Offline

 

#36 2008-01-08 18:59:58

marmot74
Member
Registered: 2008-01-08
Posts: 10

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

New DNS-323 user here!

I setup fun_plug and installed this script with little or no Linux experience and it works like a charm! Thanks for the hard work guys!

One question, if I have a USD drive to volume_1 as ex. /USB_500 will it try to back this up to the 2nd drive as well? If so how can I add exclusions?

Thanks!

Offline

 

#37 2008-01-08 19:49:06

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

ambanmba wrote:

Chumby wrote:

I noticed blbrown had some code (search for "email") in these forums that may be adapted.  Perhaps get an email sent to you "saying the job has finished" and then having the log file which has been created sent as an attachment?

Thanks for that... it looks like the post you are referring to is this one:

http://dns323.kood.org/forum/p7404-2007 … html#p7404

ambanmba

Yep, my email script can definitely do as you ask--If you grab BackupNetClone (from http://backupnetclone.sourceforge.net/) there are two files that do the actual emailing.  Look in complete_email.sh and sendmail.sh (which is an updated version from the one in the forum link you posted).

BackupNetClone is basically a fancy script for the rsync steps outlined in this thread--it sends an email status after the backup is complete.  It even reports changed files and disk space remaining on the backup server.  Unfortunately, setup is not for the faint of heart because it also uses SSH.  The website lays out the basic instructions, but I'm still working on the detailed line-by-line instructions for how to get a whole backup system up and running.

If you email me (details on the website), I can send you the text files I have with all the raw commands that I used to set everything up--it's a bit messy but might help you past some of the installation hurdles.

Another thing to note about the email script I wrote is that it only handles simple SMTP servers--those with no authentication or basic username/pw authentication.  So Gmail, Yahoo, and others that require SSL won't allow BackupNetClone to send its status emails.  Anyone interested in getting SSL compiled natively for the DNS-323?  smile

Offline

 

#38 2008-01-09 14:12:05

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Can someone explain step by step how to create the file named editcron.sh and put it in the fun_plug.d/start directory? I reformatted the drive and installed fonz funplug 0.3. But i can't get acces to this directory (from a windows XP computer).

Offline

 

#39 2008-01-10 06:05:20

Chumby
Member
From: Tasmania, Australia
Registered: 2007-08-01
Posts: 96
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Hi Knireis,

It is in the tutorial (towards the top).  After you have installed the fun_plug, have you been able to telnet in OK with PUTTY?

Cheers,
Chumby

Offline

 

#40 2008-01-10 08:50:17

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby wrote:

Hi Knireis,

It is in the tutorial (towards the top).  After you have installed the fun_plug, have you been able to telnet in OK with PUTTY?

Cheers,
Chumby

Yes i can telnet to the NAS, but i copied the file using windows explorer or ftp, but i can't get access to the funplug.d folder or its subfolders. Do i create the file also using putty? How do i do this?

Offline

 

#41 2008-01-10 18:04:40

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

The fun_plug.d folder and subdirectories were created from the fun_plug script
and fun_plug.tar file, which is run at startup, as the root user.  In order to access
these directories and files you need to connect to the DNS-323 as the root user.

You can access the DNS-323, as root, with telnet, and create the files with the vi editor.


DNS-323 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB RAID1 FW1.03 ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#42 2008-01-10 19:34:56

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

mig wrote:

The fun_plug.d folder and subdirectories were created from the fun_plug script
and fun_plug.tar file, which is run at startup, as the root user.  In order to access
these directories and files you need to connect to the DNS-323 as the root user.

You can access the DNS-323, as root, with telnet, and create the files with the vi editor.

Thank you for the information, I'm quite new to this stuff, can you maybe write down the steps to achieve this?

Offline

 

#43 2008-01-10 19:51:05

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby did an excellent job of detailing the steps required in the first post of this thread.

What exactly are you having trouble with in the

   STEP THREE Create a Scheduled Backup

section?


DNS-323 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB RAID1 FW1.03 ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#44 2008-01-10 20:16:52

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

mig wrote:

What exactly are you having trouble with in the

   STEP THREE Create a Scheduled Backup

section?

I can telnet in via putty, but don't know if this is as root and i don't know how to create the editcron.sh file in the specified folder. from there to edit the file the instructions seem to be clear enough

Offline

 

#45 2008-01-10 21:37:41

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

O.K. I think I see your confusion, The instructions in code box of the section

   1) After you have telneted into the dns323 and can see the # prompt, type in the following line of code:

    vi /mnt/HD_a2/fun_plug.d/start/editcron.sh

creates the file. 

When you issue the vi command with a filename (that does not exist) vi will
create a new blank file, with the name you input.

'vi' is a command line text editor, you should google 'vi editor' to get an overview of the 'vi' editor,
'vi' can be very intimidation for new users.

Also, the telnet server, setup by fun_plug connects as root.

Good luck!


DNS-323 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB RAID1 FW1.03 ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#46 2008-01-10 21:51:36

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

mig wrote:

O.K. I think I see your confusion, The instructions in code box of the section

   1) After you have telneted into the dns323 and can see the # prompt, type in the following line of code:

    vi /mnt/HD_a2/fun_plug.d/start/editcron.sh

creates the file. 

When you issue the vi command with a filename (that does not exist) vi will
create a new blank file, with the name you input.

'vi' is a command line text editor, you should google 'vi editor' to get an overview of the 'vi' editor,
'vi' can be very intimidation for new users.

Also, the telnet server, setup by fun_plug connects as root.

Good luck!

Thanks

Offline

 

#47 2008-01-11 07:58:42

marmot74
Member
Registered: 2008-01-08
Posts: 10

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Someone please help me out here.

On this line

/bin/echo "5 2 * * * /mnt/HD_a2/fun_plug.d/bin/rsync -rlptDv --delete /mnt/HD_a2 /mnt/HD_b2 >/mnt/HD_a2/fun_plug.d/log/rsync.last.log 2>&1" >> $CRONTXT

What do I add if I want to exclude a directory from the sync?

Offline

 

#48 2008-01-12 06:23:21

DaveN
Member
Registered: 2008-01-12
Posts: 21

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Nice.  However a small correction should be made.

The very first line of your script (as it existed on Jan 11, 2008) is incorrect:
!#/bin/sh
should be changed to
#!/bin/sh

Even with the error the script runs OK, however the following will appear in fun_plug.d\log\fun_plug.log
<snip>
* Running /mnt/HD_a2/fun_plug.d/start/editcron.sh start ...
/mnt/HD_a2/fun_plug.d/start/editcron.sh: !#/bin/sh: No such file or directory
<snip>

Cheers,
Dave.

Offline

 

#49 2008-01-12 06:43:46

DaveN
Member
Registered: 2008-01-12
Posts: 21

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

marmot74,

telnet in and type "rsync" at the command prompt.  You will get the list of all options that rsync accepts.  One of the options is:
--exclude=PATTERN       exclude files matching PATTERN

Also, a good web page to refer to is the man page:
http://rsync.samba.org/ftp/rsync/rsync.html

--exclude "foo/"  would exclude any directory called foo

Cheers,
Dave.

Offline

 

#50 2008-01-12 09:19:07

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

DaveN wrote:

The very first line of your script (as it existed on Jan 11, 2008) is incorrect:
!#/bin/sh
should be changed to
#!/bin/sh

Nice catch, DaveN.  Chumby actually copied this error from a post I made back in 0ct, 2007.
I corrected that post tonight, Chumby can take care of the correction in his writeup in this
thread.


DNS-323 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB RAID1 FW1.03 ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB