From owner-freebsd-questions@FreeBSD.ORG Fri Jan 18 03:15:36 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BCAFE2A3 for ; Fri, 18 Jan 2013 03:15:36 +0000 (UTC) (envelope-from freebsd@chthonixia.net) Received: from www5.pairlite.com (www5.pairlite.com [64.130.10.15]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD0D8F7 for ; Fri, 18 Jan 2013 03:15:36 +0000 (UTC) Received: from whisperer.chthonixia.net (unknown [184.152.30.105]) by www5.pairlite.com (Postfix) with ESMTPSA id C3B8F2E2BD for ; Thu, 17 Jan 2013 22:15:29 -0500 (EST) Date: Thu, 17 Jan 2013 22:16:56 -0500 From: Joe Altman To: FreeBSD questions Subject: Re: tar & compression Message-ID: <20130118031656.GA82737@whisperer.chthonixia.net> References: <50F8B3A3.9080909@a1poweruser.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50F8B3A3.9080909@a1poweruser.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 03:15:36 -0000 On Thu, Jan 17, 2013 at 09:29:55PM -0500, Fbsd8 wrote: > The man page for tar command says there a 4 different compress types > you can use, xz, bzip, bzip2 and gzip. xz uses Lempel-Ziv-Markov chain algorithm. bzip2 uses Burrows-Wheeler transform. > Which one is the fastest and compresses the most? Sounds like a case of fast or cheap: choose one. Or is it fast or expensive? Or maybe it's all just bragging. OTOH, apropos compression may be instructive: 7z (and related) > I am using -z option for gzip and it sure is slow. > Hoping one of the other zip options are better. > What do you guys use? Used to use bzip2 and tar. Nowadays I just place files on a big disk that only runs when I backup my bits. > Another question about tar is can I have tar create a compressed bkup > of 2 files and a directory tree all in single tar command? For directories, I've used this: tar -cf - -C srcdir . | tar xpf - -C destdir The tar man page has this: tar -czf file.tar.gz source.c source.h Since anything is a file, it seems to me it would work on a directory with this: tar -czf file.tar.gz source.c source.h /path/to/directory I also note that (since you've mentioned mtree) the man page on tar provides an example on mtree. Could this be applied to your needs? Best regards, Joe