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 2011-12-03 10:08:32

rtg20
Member
Registered: 2007-12-23
Posts: 34

Time machine backup to DNS-323...it almost works!

Hi I have ffp running on my DNS-323 (FW 1.09). I want to use rsync to backup my laptop (runs Ubuntu 11.10) to my DNS-323.

I found this site:

http://blog.interlinked.org/tutorials/r … .yaml.html

and created this script which seems to work. Initial transfer of files took days (only got 8 MBit which I read elsewhere on this forum is about normal) but subsequently it's pretty fast to copy over the changes in files.

=====
#!/bin/sh

SOURCE="/home/richard/Documents /home/richard/Pictures"
HOST=richard@192.168.1.2

date=`date "+%Y-%m-%dT%H_%M_%S"`
rsync -azPE --link-dest=/mnt/HD_a2/Richard/current $SOURCE $HOST:/mnt/HD_a2/Richard/back-$date \
  && ssh $HOST "rm /mnt/HD_a2/Richard/current \
  && ln -s back-$date /mnt/HD_a2/Richard/current"
=====

Question: how do I stop the script prompting for a password? It wants the ssh password twice, I understand it needs it for the part where it creates the link at the end, but I thought rsync didn't need ssh to run (and encrypting ssh traffic with rsync slows it way down)????

I did enable rsyncd on the DNS-323.

Thanks

Richard

Offline

 

#2 2011-12-03 14:39:17

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Time machine backup to DNS-323...it almost works!

google for "setup ssh keypair"

Offline

 

#3 2011-12-03 17:30:47

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: Time machine backup to DNS-323...it almost works!

The default remote shell for rsync is ssh (http://www.samba.org/ftp/rsync/rsync.html).

If you want to stay with ssh, you'll need to set up a key pair, as already suggested.  (http://www.ibm.com/developerworks/libra … index.html)


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#4 2011-12-03 19:30:23

rtg20
Member
Registered: 2007-12-23
Posts: 34

Re: Time machine backup to DNS-323...it almost works!

thanks for the replies, I can do that.

BUT I thought that using ssh would slow things up, that's why I have rsyncd running on the DNS323. I set up rsync.secrets too.

How do I make rsync not use ssh...?

Or maybe I misunderstand.

(I don't need encryption, this is over a local network in my house.)

thanks!

Offline

 

#5 2011-12-03 20:24:05

rtg20
Member
Registered: 2007-12-23
Posts: 34

Re: Time machine backup to DNS-323...it almost works!

ah hang on, two colons, let me see if I can fix it. :-)

Offline

 

#6 2011-12-03 20:32:31

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Time machine backup to DNS-323...it almost works!

ok you should read the "man" page for rsync.
like here http://ss64.com/bash/rsync.html

1. connecting using rsync server has syntax  rsync://[user@]host[:PORT]/Source [Dest]

2.
Some paths on the remote server may require authentication.
If so then you will receive a password prompt when you connect.
You can avoid the password prompt by setting the environment variable
RSYNC_PASSWORD to the password you want to use or using the --password-file option.
This may be useful when scripting rsync.

Offline

 

#7 2011-12-03 20:39:15

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Time machine backup to DNS-323...it almost works!

Also if you are running ubuntu there are already complete software for this. Great backup easily installed via software center. I think you should skip your homebrewed solution, and go for the good stuff instead, no offence.

deja-dup and backin-time are both great and free.

Last edited by bjby (2011-12-03 20:43:59)

Offline

 

#8 2011-12-04 23:20:35

rtg20
Member
Registered: 2007-12-23
Posts: 34

Re: Time machine backup to DNS-323...it almost works!

Ok thanks for the help. I have it working now using rsync and not ssh, without prompting for passwords.

Here's the output from du


richard@dlink-EE62FD:/mnt/HD_a2/Richard$ du -shc back*
16.0k    back-2011-11-26T09_51_02
8.0k    back-2011-11-26T09_51_57
8.0k    back-2011-11-26T09_52_22
8.0k    back-2011-11-26T09_53_26
2.2M    back-2011-11-26T09_54_13
173.5G    back-2011-11-26T09_56_51
24.7M    back-2011-11-28T08_38_56
31.2M    back-2011-12-02T23_20_59
23.7M    back-2011-12-02T23_28_23
23.7M    back-2011-12-02T23_31_00
23.7M    back-2011-12-03T10_22_54
27.2M    back-2011-12-03T16_59_14
23.7M    back-2011-12-03T22_45_01
23.7M    back-2011-12-03T23_13_40
23.7M    back-2011-12-03T23_26_52
23.7M    back-2011-12-03T23_29_28
23.7M    back-2011-12-04T00_00_01
23.7M    back-2011-12-04T12_30_01
173.8G    total


As you can see, I transferred most of the files over on Nov 26.

Is it safe to delete the backup directory created on this date? I want to delete the old backups. I was expecting the current directory to have all my stuff so it should be ok, but du seems to show most of the files present in the directory created on Nov 26.

(current is created as shown in my first post on this thread using ln -s )

Any thoughts?

thanks

Richard
PS Yes, homebrew is slower, I thought it would be easier based on all the info on here, but most of the rsync stuff is for copying one disk to another and i'm using RAID.

Offline

 

#9 2011-12-04 23:35:54

rtg20
Member
Registered: 2007-12-23
Posts: 34

Re: Time machine backup to DNS-323...it almost works!

Hmm I just did


richard@dlink-EE62FD:/mnt/HD_a2/Richard$ du -shc current/
173.5G    current
173.5G    total


so maybe i just answered my own question...

Offline

 

#10 2011-12-06 22:56:34

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: Time machine backup to DNS-323...it almost works!

If your filespec to du includes more than one hard link to the same file, du will count only one of the hard links as actual disk usage.  That is what happened when you said "du back*".

Since you are using rsync link-dest to make these hard links, you'll have multiple hard links to each file from multiple backup directories.  So, if you delete one backup directory, there will be other links from the other backup directories that will keep the file "alive", until you reduce the hard link count to zero.

If a file changes between backups, only the OLDER backups will contain links to the old version of the file.  The new version of the file will have links to it from newer backups, but will gain links to it as you make more backups.  The old version of the file will survive until you prune away enough of the older backup directories.  Most people using schemes like this one delete the older backup dirs as they accumulate, which will purposefully delete older versions of changed files.

To make sure you are deleting what you expect, try:

find back-2011-11-26T09_56_51 -links 1

This will list all the files that have only one link.  These files would be deleted if you delete the back-2011-11-26T09_56_51 directory.  If no files are listed then there is at least one other backup directory keeping links to all the same files.  You could then delete back-2011-11-26T09_56_51 without losing a thing.

Last edited by karlrado (2011-12-07 00:35:27)


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#11 2011-12-10 09:26:28

rtg20
Member
Registered: 2007-12-23
Posts: 34

Re: Time machine backup to DNS-323...it almost works!

Thank you so much! I understand it now. :-)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB