Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2003 13:22:12 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        "Jay J Liew (20004)" <jliew1@shaman.cs.ulm.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: file & dir ownership & permissions
Message-ID:  <20030410102212.GA776@gothmog.gr>
In-Reply-To: <Pine.GSO.4.05.10304100108330.6180-100000@shaman>
References:  <Pine.GSO.4.05.10304100108330.6180-100000@shaman>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2003-04-10 01:13, "Jay J Liew (20004)" <jliew1@shaman.cs.ulm.edu> 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$



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030410102212.GA776>