Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 1996 02:29:00 -0700 (PDT)
From:      "David E. O'Brien" <obrien@Nuxi.cs.ucdavis.edu>
To:        narvi@haldjas.folklore.ee (Narvi)
Cc:        freebsd-ports@freebsd.org (FreeBSD ports list)
Subject:   Re: using tar
Message-ID:  <199608100929.CAA01408@relay.nuxi.com>
In-Reply-To: <Pine.BSF.3.91.960810120555.13368M-100000@haldjas.folklore.ee> from Narvi at "Aug 10, 96 12:08:35 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> > > I want to use tar to move a directory hierarchy, but I want to do it
> > > without using a temp directory, and I don't know the syntax to make tar
> > > create an archive to stdout, then read from stdout to extract the acrchive
> > 
> > 	tar -cf - -C $SRCDIR . | tar xpf - -C $DESTDIR
> > 
> > Will do the trick.
> 
> Why not just mv $SRCDIR $DESTDIR? Yes, if $DESTDIR exist you will have to 
> write a for $i in ...; do mv $i $DESTDIR; done?

Many mv's can't move a directory structure across devices (read disk
partitions) because of the limitations of rename(2).  Thus you can only
use mv if $SRCDIR and $DESTDIR are on the same partition.

For instance, GNU's mv gives:
    mv: cannot move `foo' across filesystems: Not a regular file


-- David    (obrien@cs.ucdavis.edu)



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