From owner-freebsd-questions@FreeBSD.ORG Thu Apr 10 03:28:50 2003 Return-Path: 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 BD3DD37B401 for ; Thu, 10 Apr 2003 03:28:49 -0700 (PDT) Received: from thalia.otenet.gr (thalia.otenet.gr [195.170.0.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CE5D43FD7 for ; Thu, 10 Apr 2003 03:28:47 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b160.otenet.gr [212.205.244.168]) by thalia.otenet.gr (8.12.9/8.12.9) with ESMTP id h3AASh72007742; Thu, 10 Apr 2003 13:28:44 +0300 (EEST) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.9/8.12.9) with ESMTP id h3AASb9h020861; Thu, 10 Apr 2003 13:28:42 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.9/8.12.9/Submit) id h3AAMC2u010708; Thu, 10 Apr 2003 13:22:12 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 10 Apr 2003 13:22:12 +0300 From: Giorgos Keramidas To: "Jay J Liew (20004)" Message-ID: <20030410102212.GA776@gothmog.gr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-questions@freebsd.org Subject: Re: file & dir ownership & permissions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 10:28:50 -0000 On 2003-04-10 01:13, "Jay J Liew (20004)" wrote: > Is there some kind of system maintainance tool that saves file and > directory ownership and permissions? Technically, it'd be a proper > subset of GNU tar since GNU tar not only ``tars'' into a tarball but > it also preserves the ownership and permission structure on all files > and directories. Please cc: Thanks. Have a look at mtree(8). Here's the output of running it on a test hierarchy: giorgos@gothmog[13:17]/tmp/alpha$ mtree -c > /tmp/spec.alpha giorgos@gothmog[13:17]/tmp/alpha$ cd .. giorgos@gothmog[13:17]/tmp$ mkdir beta giorgos@gothmog[13:17]/tmp$ cd beta giorgos@gothmog[13:17]/tmp/beta$ mtree -eU < /tmp/spec.alpha . changed modification time expected Thu Apr 10 13:17:10 2003 found Thu Apr 10 13:17:57 2003 giorgos@gothmog[13:18]/tmp/beta$ ls giorgos@gothmog[13:18]/tmp/beta$ cat /tmp/spec.alpha # user: giorgos # machine: gothmog.gr # tree: /tmp/alpha # date: Thu Apr 10 13:17:53 2003 # . . type=dir uid=1001 mode=0775 nlink=2 size=512 \ time=1049969830.0 flags=none .. giorgos@gothmog[13:18]/tmp/beta$