Re: Alternative to tar?
Moin, '/bin/afio' is another interesting tool compared to 'tar', though it might not compress better. It's main advantage is: It compresses each file separately and then adds it to the archive. This means that a data corruption will only cause data losses of the files affected, but won't render the whole archive useless. regards Wilko -- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20120725233304.ga5...@fok01.laje.edewe.de
Re: Alternative to tar?
Gaël DONVAL wrote: > Do you know of any lighter/simpler alternative to the tar program? > tar preserves permissions, time stamps, etc. and this is great in some > cases. But in other cases, one just wants a simple way to concatenate > files. The old 'ar' archive is fairly lightweight. Couple that with 'lzip' and you would have a fast and light combination. $ ar cru somename.ar file1 file2 file3 $ lzip somename.ar Here is a simple test using some small files: $ date > one $ date -R > two $ date +%s > three $ ar cru foo.ar one two three $ lzip foo.ar $ ar cru foo.ar one two three $ xz foo.ar $ tar caf foo.tar.gz one two three $ tar caf foo.tar.gz one two three $ tar caf foo.tar.lz one two three $ ls -log total 24 -rw-rw-r-- 1 151 Jul 25 11:46 foo.ar.lz -rw-rw-r-- 1 184 Jul 25 11:51 foo.ar.xz -rw-rw-r-- 1 216 Jul 25 11:46 foo.tar.gz -rw-rw-r-- 1 234 Jul 25 11:45 foo.tar.lz -rw-rw-r-- 1 224 Jul 25 11:45 foo.tar.xz -rw-rw-r-- 1 29 Jul 25 11:45 one -rw-rw-r-- 1 11 Jul 25 11:45 three -rw-rw-r-- 1 32 Jul 25 11:45 two Bob signature.asc Description: Digital signature
Re: Alternative to tar?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 25.07.2012 12:43, Gaël DONVAL wrote: > > Actually what I want is to compress a set of ascii files. I did > some preliminary tests and I'd like to use 7zip or xz. Oh, in that case ex isn't what you are looking for. It only extracts files. - -- Mika Suomalainen NOTICE! I am on mobile broadband with very limited time, so I cannot read emails very much. The best time to contact me is probably weekends when I have better connectivity with good luck. -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Public key: http://mkaysi.github.com/PGP/key.txt Comment: Fingerprint = 24BC 1573 B8EE D666 D10A AA65 4DB5 3CFE 82A4 6728 Comment: Why do I (clear)sign emails? http://git.io/6FLzWg Comment: Please remove PGP lines in replies. http://git.io/nvHrDg Comment: Charset of this message should be UTF-8. Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJQEBFuAAoJEE21PP6CpGconE0P/2ssG1V8z8AUuJmTSjK/jvUV kD7aIrHdpwntLcKlC4L09LnpgUNti0o0lEI9y1LnPEIdH2Eez6qcxEwGToqt1Tmb Gcx93hoYOt1YEm33MdrJ97qNN/beNKcPbA0qJuGskFXJcqbd0+r7zUQNCkilcRus j5ltwqygrauKIx1mC1/bj1YCxFI3M8yPZXrxhNAcasiAY7k3BANyQTEJ/DLQ6Gkb yClucsZTwCOmapaEigJk04uIxpdEkzGLr0opl82PnddrU5SMnvqmWzIKsGnLCT9j uozRimOIYhNekaKLreMBaQmOoTNnnTWPfHp6qJgv7ZeIL0kG934JclrIT3+zH38I 2jxMvs8ui3Sg7ilOSpGZy/nwkADjPL3wSYvdpJAg1jIbdZi77bcBq6js5XqT0iqJ 6Lwn2OltJKm4xAxEe+amPdu41vDUZQPyageyH8FkhTIXj6L6Zg9eTBAfFJlP8dql KFxuvjrNJ7CmVgDNxPKUVccNzkRrHgLXoKCjhj4manZrvceLlVyhYRf5QY80nbpq ngdjqc2p71wDqhoHgPibdulVfsmls273D3LwoTlnzq2bJZmikcdDUoYe+uA+Z9pT +MQAIULX6PD0d1aMhlvGG81JopXHvlqQjL/4oavfksA2+CY9YqGWgxDlzJL7FNNz +hNsk06iG7qaaykxLIT3 =DJZ9 -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/50101171.4080...@hotmail.com
Re: Alternative to tar?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 07/25/2012 11:53 AM, Gaël DONVAL wrote: > Do you know of any lighter/simpler alternative to the tar program? > [...] Any idea? There is bash function, which makes tar simpler to use. I know that it's not alternative, but it might be good alternative to alternative. I will attach it to this email. To use it, just copy-paste it to your bashrc or zshrc or whatever shell you use rc. To use it, just run "ex something.zip" and it will extract it. - -- Mika Suomalainen NOTICE! I am on mobile broadband with very limited time, so I cannot read emails very much. The best time to contact me is probably weekends when I have better connectivity with good luck. -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Public key: http://mkaysi.github.com/PGP/key.txt Comment: Fingerprint = 24BC 1573 B8EE D666 D10A AA65 4DB5 3CFE 82A4 6728 Comment: Why do I (clear)sign emails? http://git.io/6FLzWg Comment: Please remove PGP lines in replies. http://git.io/nvHrDg Comment: Charset of this message should be UTF-8. Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJQEBEHAAoJEE21PP6CpGcoIioQALL0U8pWNHigTyR14tSLEWOC GY9S92JBtviI8IkmzJpSPYeiUZbgFHoG5qHDSjJbKKREcRsuGWvMofyqagV0fgbs evHg+/Z38b92BUsIhOg4cmY4OOkh/IHh52SnLUpxUAnzzV7n854dA8b2E+Zq7OGk iFFsp74nygeM7VB4kM3nAFZ/i838UW2gX5/girHE/cTynSKLOptt0aq6m3/d5UtT H088GTSGwAl+M9cldz9sJ6NY+E5gtvIA0Ogk7QspSPANtOJp31mo12IKtZZFqRTA MIYsm0zPNCY505rdsliBcY6ObklyuwrPfKDJL+DQDVRnF7XjMZ/JGJ/9FbKtXc2r 5fUWS0embMTfTEqla62m+HqIFN4L7dWDwD/HAZOHK16pdud1AE32PTf5LGHRfPtE jiv9PtR+VvrlhuAASlZTRqHEjGdIVlEEp3jafmeQ9t1l1TcMo3TXcC1AwoZyYnzI iQfApQT8/KbLzt4E6ZJjxig6Iq1w6xzOmE0KOfB1/Sy1a9Bdd8aEEiA0Tej6PIWy D9G1M3kU6xqLbfHqlrsqm/b2K3ixFJkVzMjnvqlwB+80qOyUTxFt79q1v3K/IRtU KzIUNEd11xJmOMkOSFaNkfuvuz50OC6mEho5coPevMuZxoyFOL7q2iUd1HuGEd02 /4z6ULgaho+iF1paGG6c =x96a -END PGP SIGNATURE- # ex command. Copied from zshrc of bioterror ( http://ricecows.org/configs/zsh/.zshrc ). Original comment below: ## for unit193 ;) ## use command "ex" to extract any archive files. ## "ex package.zip" for example function ex () { if [ -f "$1" ] ; then case "$1" in *.tar)tar xvf $1 ;; *.tar.bz2 | *.tbz2 ) tar xjvf $1 ;; *.tar.gz | *.tgz )tar xzvf $1 ;; *.bz2)bunzip2 $1 ;; *.rar)unrar x $1 ;; *.gz) gunzip $1 ;; *.zip)unzip $1;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *.xz) tar xJvf $1 ;; *.deb) DIR=${1%%_*.deb} ar xv $1 mkdir ${DIR} tar -C ${DIR} -xzvf data.tar.gz;; *.rpm) rpm2cpio $1 | cpio -vid ;; *) echo ""${1}" cannot be extracted via extract()" ;; esac else echo ""${1}" is not a valid file" fi } ex.txt.sig Description: PGP signature
Re: Alternative to tar?
Gaël DONVAL wrote: > Do you know of any lighter/simpler alternative to the tar program? > tar preserves permissions, time stamps, etc. and this is great in some > cases. But in other cases, one just wants a simple way to concatenate > files. cat cpio 7z zip Tar is pretty lightweight (at least, it was until GNU got hold of it). tar cf target.tar source... tar xf target.tar "target.tar" can be "-" to reference stdin/stdout (i.e. a pipe). If you restore files with it as root, it attempts to handle ownerships and permissions on extraction. If you don't it does what it can. Add "z" or "j" as te first letter argument to enable compression (gzip and bzip2, respectively). Cat does exactly what you've asked for, "a simple way to concatenate files", but I suspect that's not what you really mean. Cpio is marginally more flexible but wildly complicated. 7z and zip have ancestors in the DOS world but can be considered as equivalent to tar with compression enabled. Different process, though: 7z and zip compresses each file separately (I believe) and adds the result to the archive. Tar/gzip adds each file to the archive and compresses the result. Chris -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/qgt4e9xkdb@news.roaima.co.uk
Re: Alternative to tar?
On Wed, 2012-07-25 at 11:37 +0200, Ralf Mardorf wrote: > On Wed, 2012-07-25 at 10:53 +0200, Gaël DONVAL wrote: > > Hi, > > > > Do you know of any lighter/simpler alternative to the tar program? > > tar preserves permissions, time stamps, etc. and this is great in some > > cases. But in other cases, one just wants a simple way to concatenate > > files. > > > > Any idea? > > I'm using tar, but you might want http://en.wikipedia.org/wiki/7-Zip . > Hth, > Ralf http://en.wikipedia.org/wiki/7z -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1343209415.1259.33.camel@localhost.localdomain
Re: Alternative to tar?
> > Do you know of any lighter/simpler alternative to the tar program? [...] > > Any idea? > > cpio? > > -- > RMA. Thanks Mihamina, Kushal and Mark. Actually what I want is to compress a set of ascii files. I did some preliminary tests and I'd like to use 7zip or xz. When used on single files, xz performs consistently better... Well, actually, these individual files are small so this might just be related to a fixed size header which is just smaller in the xz file format... But xz also allows stream compression using pipes, which is definitely a plus. However, that's it: xz can't compress a full directory. I tried to use tar but the FS metadata make the compressed file heavier. cpio (completely forgot about this one) allows me to reach 7zip compression ratio with xz, works very well with streams and is available on many, if not all Linux systems. Thanks for your suggestion Mihamina, Kushal. Kushal, I did not find any option to disable FS metadata preservation in tar man page. I might have missed something though. But I am curious to see if this can be achieved with tar. Mark, thanks for your suggestion. I have not been precise enough. And actually, xz files can be catted together, but each of the xz file keeps its header. And since these headers are almost identical, one can compress them again. But still, the result is not great. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1343209423.8462.21.ca...@p76-nom-gd.cnrs-imn.fr
Re: Alternative to tar?
On Wed, 2012-07-25 at 10:53 +0200, Gaël DONVAL wrote: > Hi, > > Do you know of any lighter/simpler alternative to the tar program? > tar preserves permissions, time stamps, etc. and this is great in some > cases. But in other cases, one just wants a simple way to concatenate > files. > > Any idea? I'm using tar, but you might want http://en.wikipedia.org/wiki/7-Zip . Hth, Ralf -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1343209067.1259.32.camel@localhost.localdomain
Re: Alternative to tar?
On Wed, Jul 25, 2012 at 2:23 PM, Gaël DONVAL wrote: > Hi, > > Do you know of any lighter/simpler alternative to the tar program? > tar preserves permissions, time stamps, etc. and this is great in some > cases. But in other cases, one just wants a simple way to concatenate > files. > > Any idea? > If all you want is not to preserve permissions, timestamps, etc., you can use the appropriate options to the tar program to disable those features. If you object to the tar format itself, you can look at cpio, which might support some more formats. (although the tar program seems to have grown support for several (most?) of those). If you want a smaller/simpler tar program for some reason, busybox has a version of tar, which has much fewer options. But, unless you are in an environment that is already using busybox, you probably won't have a net gain if you install busybox just for a smaller tar. -- regards, kushal -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/cah8gtdmsoa1-wyvjrqtzx19+xr1t6bbt59hsfsnko6ev6z4...@mail.gmail.com
Re: Alternative to tar?
On Wednesday 25 July 2012 4:53:51 am Gaël DONVAL wrote: > Hi, > > Do you know of any lighter/simpler alternative to the tar program? > tar preserves permissions, time stamps, etc. and this is great in some > cases. But in other cases, one just wants a simple way to concatenate > files. > > Any idea? cat ? -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/201207250508.05497.m...@neidorff.com
Re: Alternative to tar?
On 07/25/2012 11:53 AM, Gaël DONVAL wrote: Do you know of any lighter/simpler alternative to the tar program? [...] Any idea? cpio? -- RMA. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/500fb489.9080...@rktmb.org
Alternative to tar?
Hi, Do you know of any lighter/simpler alternative to the tar program? tar preserves permissions, time stamps, etc. and this is great in some cases. But in other cases, one just wants a simple way to concatenate files. Any idea? -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1343206431.6752.24.ca...@p76-nom-gd.cnrs-imn.fr