Restricting tar or pax to a single file system

Giorgos Keramidas keramida at
Sun Nov 22 22:57:36 UTC 2009

On Sun, 22 Nov 2009 08:01:07 -0800 (PST), jaymax <jaymax36 at> wrote:
> I think my reply went to the previous post, but here is
> The syntax here is confusing, should it be >
> [ignoring other options]
> tar -c -W one-file-system -f tarfile2Becreated.tar /
> {
> From the man pages
> -W longopt=value
> Long options (preceded by --) are only supported directly on systems that
> have the getopt_long(3) function.  The -W option can be used to access long
> options on systems that do not support this function.
> }
> Or is there another synopsis?

Yes, there are a few alternative ways to phrase the same thing. For example:

    cd /
    tar -cf /backup/tarball.tar --one-file-system .
    tar -c --one-file-system -f /backup/tarball.tar .

You can combine the options of tar in almost *any* order with a bit of
care.  For example, here's a small part of my incremental backup script:

    cd /home/keramida/.zfs/snapshot/today
    env TZ=UTC tar -c --one-file-system --newer-mtime '2009-11-20 00:00:00' \
        -f '/backup/home.keramida.2009-11-20.tar' .

More information about the freebsd-questions mailing list