Matt Randolph wrote:

Nick Rout wrote:

On Sat, 2005-08-13 at 09:36 -0400, Jerry McBride wrote:
On Saturday 13 August 2005 01:32 am, Nick Rout wrote:
On Sat, 2005-08-13 at 00:58 -0400, Jerry McBride wrote:
Anyone else here subscribe to the LINUX JOURNAL?

In the September issue there's a neat article titled tha same as the
subject line of this message.

The skinny is, there's some really nice file compressors out there and I
never heard of two of them... Anyone else know about LZMA or 7ZA?

The two mentioned compression tools work pretty much like gzip. You tar up your files, pipe to the compression filter and then on to the target
file. Below is a small example of what I've been seeing here at the
shack.

-rw-r--r--  1 root root 12359680 Aug 12 23:57 backup.tar
-rw-r--r--  1 root root  3536665 Aug 13 00:01 backup.tar.7z
-rw-r--r--  1 root root  4438465 Aug 13 00:08 backup.tar.bz2
-rw-r--r--  1 root root  4747637 Aug 13 00:03 backup.tar.gz
-rw-r--r--  1 root root  2731412 Aug 13 00:10 backup.tar.lzma
-rw-r--r--  1 root root  5125474 Aug 13 00:16 backup.tar.lzop

What you're seeing are the results of compressing /lib on my gentoo
powered laptop. I've not bothered with timing the processes as the better compression rates are at the cost of speed and memory usage. Not good for
"while you wait" processing, but just plain perfect for backups and
what-have-you on servers... One side note, 7za does not record user/group
info...

Are you saying it removes user/group info from the tar file?


Not "removed", it's never put there... :')



I'm sorry but how do you create a tar file without preserving the
usernames and permissions?


This may be a case of a different paradigm being used by 7-zip than that used by traditional (*nix) compression tools. If my memory serves me, the 7-zip format is very similar to the pkzip format in its usage. By that I mean that one is not required to make a tarball before compressing multiple files. The format allows you to skip the tar step and make an archive consisting of whichever files and directories you wish.

The problem, I'm guessing, is that the 7-zip archive format was developed in the Windows world where users and groups and permissions have no meaning (I think that has changed or is changing in the NT/XP world, but I don't know and don't especially care). Hence, these attributes aren't accomodated by this format. I assume the 7-zip extractor program sets the user and group of the extracted files to that of whomever extracts them.

What everyone has rightly pointed out, namely that you can make a tarball and then compress that, is exactly right. That IS how one would use 7-zip with a proper operating system.

The original poster most likely used the 7-zip archiver as a stand-alone tool, rather than using it in conjunction with tar. This is not altogether surprising as one typically compresses a directory with a single tar command (and an implied pipe) rather than explicitly piping the output of tar to the compression utility. Since there is no --7-zip switch in tar, the OP couldn't simply 'tar -7cf backup.tar.7zip lib/'. The OP probably simply 7-zipped his directory without tarring it first and consequently ran into the limitations of the archive format.

"-rw-r--r--  1 root root  3536665 Aug 13 00:01 backup.tar.7z"

Oops!  I should read more carefully.

--
"Pluralitas non est ponenda sine necessitate" - W. of O.

--
gentoo-user@gentoo.org mailing list

Reply via email to