From owner-freebsd-questions@FreeBSD.ORG Wed Aug 31 07:14:40 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 8588D16A41F for ; Wed, 31 Aug 2005 07:14:40 +0000 (GMT) (envelope-from svein-freebsd-questions@theloosingend.net) Received: from merke.itea.ntnu.no (merke.itea.ntnu.no [129.241.7.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAE8B43D55 for ; Wed, 31 Aug 2005 07:14:37 +0000 (GMT) (envelope-from svein-freebsd-questions@theloosingend.net) Received: from localhost (localhost [127.0.0.1]) by merke.itea.ntnu.no (Postfix) with ESMTP id E448E13C4FC for ; Wed, 31 Aug 2005 09:14:36 +0200 (CEST) Received: from maren.thelosingend.net (maren.math.ntnu.no [129.241.211.48]) by merke.itea.ntnu.no (Postfix) with SMTP for ; Wed, 31 Aug 2005 09:14:36 +0200 (CEST) Received: (qmail 29092 invoked by uid 1001); 31 Aug 2005 09:14:36 +0200 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 31 Aug 2005 09:14:36 +0200 Date: Wed, 31 Aug 2005 09:14:36 +0200 (CEST) From: Svein Halvor Halvorsen X-X-Sender: sveinhal@maren.thelosingend.net To: Garance A Drosihn In-Reply-To: Message-ID: <20050831091404.W29039@maren.thelosingend.net> References: <20050828234043.H22315@maren.thelosingend.net> <20050829161506.E2522@maren.thelosingend.net> <43131C85.1070100@meijome.net> <20050829170053.M3014@maren.thelosingend.net> <43133BA5.2010608@scls.lib.wi.us> <20050830091919.J13913@maren.thelosingend.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Content-Scanned: with sophos and spamassassin at mailgw.ntnu.no. Cc: questions@freebsd.org Subject: Re: rsync and moving files [Re: backup w/ snapshots] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2005 07:14:40 -0000 * Garance A Drosihn [2005-08-30 12:50 -0400] > Fwiw, I understand the problem you're trying to describe. And the > basic issue is that rsync keeps no information between separate > runs of it. It has no way of knowing that a given file on the > source volume used to be at a different location. It does not even > know that the destination volume was sync'ed by a previous run of > rsync, so it does not even know that the file at the old location > on the destination is the same as the file at the old location on > the source. It knows nothing more than the information it has at > the moment of any given run of rsync. > > You could kinda fudge that information for rsync by creating a lot > of hard links, but that is probably going to create more of a mess > than it will solve. > > So, you're left with doing something else outside of rsync. The > script you are suggesting would probably be fairly easy to write > in something like ruby, perl, or python. Use a key made up of the > inode number + lastchange date, or maybe inode number + file size. > Then save away the key-to-filename(s) mapping for every file. On > the next run of rsync, see which files have moved on the source > directory. If the destination volume has a file at the old location > which matches the file-size or lastchange date (depending on which > key you used...), then move it to the new location on the destination > volume. Thanks! I think I will try to implement this, then!