From owner-freebsd-questions@FreeBSD.ORG Mon Aug 29 16:14:55 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD46D16A41F for ; Mon, 29 Aug 2005 16:14:55 +0000 (GMT) (envelope-from freebsd@meijome.net) Received: from sigma.octantis.com.au (ns2.octantis.com.au [207.44.189.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47FA743D48 for ; Mon, 29 Aug 2005 16:14:55 +0000 (GMT) (envelope-from freebsd@meijome.net) Received: (qmail 14771 invoked from network); 30 Aug 2005 02:14:54 +1000 Received: from 203-217-79-78.dyn.iinet.net.au (HELO ?192.168.13.3?) (203.217.79.78) by sigma.octantis.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 30 Aug 2005 02:14:54 +1000 Message-ID: <43133459.9030000@meijome.net> Date: Tue, 30 Aug 2005 02:14:17 +1000 From: Norberto Meijome User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@freebsd.org References: <20050828234043.H22315@maren.thelosingend.net> <20050829161506.E2522@maren.thelosingend.net> <43131C85.1070100@meijome.net> <20050829170053.M3014@maren.thelosingend.net> In-Reply-To: <20050829170053.M3014@maren.thelosingend.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: rsync and moving files [Re: backup w/ snapshots] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2005 16:14:55 -0000 Svein Halvor Halvorsen wrote: > * Norberto Meijome [2005-08-30 00:32 +1000] > >> isn't that the whole point of having a backup? to have *another* copy of your >> files? > > > Well, yes and no. > > The idea is that I have a main computer that I want to backup. I want the > backup to be (a) remote, (b) incremental and (c) random-accessible. > > So I thought that every day my backup-server could rsync my main computer, > creating a mirror of the relevant directory trees. Then, as soon as the > rsync job completes, it takes a snapshot of the filesystem. This snapshot > could be mounted r/o and nfs-exported back to the original computer. > yes, that sounds like it would meet your criteria. > > Now: If I have a file /foo/test on my main computer. After the first > rsync-job this file will be copied, assigned an inode and put on the disk > somewhere. If I change this file, a local snapshot will be smart enough to > just store the changed sectors that this file now occupies. I take your word wrt to how it works. Assuming of course that you move within the same filesystem. > But: If I move the file from /foo/test to /bar/test on my main computer, ( /foo/ and /bar/ being in the same filesystem) > rsync will create a BRAND NEW FILE in /bar (and delete the file in /foo, > since I used the --delete option). Now this NEW file will have a new > inode, and cover new sectors on disk. The snapshot will then tak > considerable more diskspace. If I move a large directory tree this way, > this will occupy huge amounts of diskspace. (touche). yup, that's what would happen....but tha's the nature of the beast :) don't keep too many snapshots ? ;) it'd be great if you could keep a log of all local-mv operations,and then replay them remotely via ssh. replace mv with your own version which does local-mv and either does remote-mv over ssh or sends a msg to a service to perform the transaction (yes, there may be other conditions that trigger the same effect as an mv...I just dont know which ones) I guess the proper way to do this (if you are REALLY REALLY worried about that extra spaced used for snapshots in the remote site) would be to implement a GEOM class that knows about the remote site and the 'mv' condition and communicate to the remote end. > So how can I make rsync know that the files were just moved (renamed, > relinked), and make rsync reflect this fact on the remote mirror? rsync would then be the wrong tool for the job. I would suggest that you just get more or larger drives for the remote site and live with the waste :) (though the GEOM class would be cool :D ) hmm...what about network operating systems like AFS or CODA (not that I know much about them, I just read some stuff on those being distruted,etc..) Let us know how you solve this. Regards, Beto