From owner-freebsd-questions@FreeBSD.ORG Sat Jan 5 18:22:45 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D41BA514 for ; Sat, 5 Jan 2013 18:22:45 +0000 (UTC) (envelope-from schultz@ime.usp.br) Received: from netuno.ime.usp.br (netuno.ime.usp.br [143.107.45.90]) by mx1.freebsd.org (Postfix) with ESMTP id 87169B21 for ; Sat, 5 Jan 2013 18:22:45 +0000 (UTC) Received: from arachne.ime.usp.br (arachne.ime.usp.br [143.107.45.22]) by netuno.ime.usp.br (Postfix) with ESMTP id 42532AC03C0 for ; Sat, 5 Jan 2013 16:12:57 -0200 (BRST) Received: by arachne.ime.usp.br (Postfix, from userid 112) id 296DA360CB6; Sat, 5 Jan 2013 16:12:56 -0200 (BRST) Received: from bd65dbab.virtua.com.br (bd65dbab.virtua.com.br [189.101.219.171]) by webmail.ime.usp.br (Horde Framework) with HTTP; Sat, 05 Jan 2013 16:12:56 -0200 Message-ID: <20130105161256.49797e7viwwtqfc8@webmail.ime.usp.br> Date: Sat, 05 Jan 2013 16:12:56 -0200 From: schultz@ime.usp.br To: freebsd-questions@freebsd.org Subject: Backup with mtree and rsync? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.10) X-Horde-Username: schultz X-Spam-Status: No, score=0.1 required=5.0 tests=MISSING_MID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on netuno.ime.usp.br X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2013 18:22:45 -0000 I have been wondering whether it is possible to create a backup system using mtree and rsync. Essentially, the user would create a mtree specification of the source directory and copy it over to the destination directory with rsync. Any changes in the destination could then be detected before restoring with the mtree specification, which should contain strong hashes of the files and should not contain the nlink keyword. The problem is that mtree would be too slow. It would recompute the hashes of big files even when they did not change from the last backup. Therefore, I would like to ask if there is an easy way to accomplish the following. Let a mtree specification of a directory from a certain point in the past be given. Also, assume that a (regular) file below that directory has not changed if its current modification time (mtime) equals its modification time in the past specification. Produce as output the new mtree specification for the directory without reading these files. This is somewhat like rsync does to perform incremental backups. P.S.: As an aside, is there an utility in the base system that can reproduce the behavior of `rsync --delete -a dir0/ dir1/`?