Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 22:36:01 +0100
From:      Stijn Hoop <stijn@win.tue.nl>
To:        Lucas Bergman <lucas@fivesight.com>
Cc:        Alson van der Meulen <alson@flutnet.org>, lists@natserv.com, FreeBSD Questions List <questions@freebsd.org>
Subject:   Re: Archiving large number of files
Message-ID:  <20011029223601.A75666@pcwin002.win.tue.nl>
In-Reply-To: <15325.52042.88160.224542@apu.five.sight>; from lucas@fivesight.com on Mon, Oct 29, 2001 at 03:34:02PM -0600
References:  <20011029151306.D53339-100000@x1-6-00-50-ba-de-36-33.kico1.on.home.com> <20011029151557.Y51329-100000@zoraida.natserv.net> <20011029212551.G30280@md2.mediadesign.nl> <15325.52042.88160.224542@apu.five.sight>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 29, 2001 at 03:34:02PM -0600, Lucas Bergman wrote:
> Alson van der Meulen wrote:
> > Francisco Reyes wrote:
> > > Dru wrote:
> > > > Francisco Reyes wrote:
> > > >
> > > > > I have several directories with 20,000+ files which I need to
> > > > > archive. I have been trying tar+Gzip, but the files are too
> > > > > many for tcsh to handle in one pass any suggestions on how to
> > > > > go about this?
> > > >
> > > > I think piping through "xargs" would do the trick.
> > > 
> > > Could you give me a quick example of how xargs work?
> >
> > find .|xargs tar cf tarball.tar
> 
> Careful.  If xargs has to spawn more than one 'tar' process, then this
> is going to overwrite tarball.tar.

Good one, never thought of that.

> Better to do
> 
>   $ rm tarball.tar
>   $ find . | xargs tar rf tarball.tar
> 
> N.B.: this assumes there are no files or directories with whitespace
> in their names.

$ rm tarball.tar ; find . -print0 | xargs -0 tar rf tarball.tar

would probably do the trick then.

--Stijn

-- 
The rain it raineth on the just
        And also on the unjust fella,
But chiefly on the just, because
        The unjust steals the just's umbrella.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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