Our logo

Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> good zip/7zip/cab/blackhole program for linux?

Red Squirrel
post Nov 5 2004, 07:43 PM
Post #1


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



I want to be able to archive stuff through the command line, mostly in automated scripts that backup stuff. I tried to use tar, but it actually makes the files like 5 times bigger, and half the time they corrupt. So I want to use something more reliable such as zip, 7zip, cab, bh etc... Is there a command, or a program I can get that will let me do this?


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Red Squirrel
post Nov 5 2004, 11:54 PM
Post #2


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



turns out I was looking at the wrong folder when I said 500MB, the original was actually 4GB and the tar was 4GB. But still, it would be nice to compress using al algorthm that is better on text. BH could get that 4GB folder in about 500MB probably. it's mostly all text. (html, php etc)


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
sintekk
post Nov 6 2004, 12:11 AM
Post #3


Done with AF
****

Group: Members
Posts: 4 466
Joined: 24-June 04
Member No.: 5
Gender: Decline to State



QUOTE(Red Squirrel @ Nov 6 2004, 12:43 AM)
I want to be able to archive stuff through the command line, mostly in automated scripts that backup stuff.  I tried to use tar, but it actually makes the files like 5 times bigger, and half the time they corrupt.  So I want to use something more reliable such as zip, 7zip, cab, bh etc...  Is there a command, or a program I can get that will let me do this?
*



http://www.flexbeta.net/main/articles.php?...&showarticle=27
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Red Squirrel
post Nov 7 2004, 01:15 PM
Post #4


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



I'm hoping for something standard though, such as zip, 7zip etc so I can open it in windows too.


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
megaspaz
post Nov 7 2004, 02:26 PM
Post #5


¥öÛ ÞLÆ¥ L¦KË Æ G¦RL
**

Group: Members
Posts: 182
Joined: 25-June 04
From: Silly Con Valley
Member No.: 21
Gender: Male



are you using the gzip option in tar? using tar without either the -z or -j option won't compress the archive. i don't know what command you're using but i've never had a corrupt gzipped tar archive. you may want to try bzip2 if gzip isn't compressing enough for you. it's the -j option in tar. also look into either man gzip or man bzip2 as there are options to use more agressive compression for both.

This post has been edited by megaspaz: Nov 7 2004, 02:26 PM


--------------------
user posted image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Red Squirrel
post Nov 7 2004, 04:44 PM
Post #6


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



Oh I figured it did it by default, anyway I checked the help file and tried a few commands to no avail.

tar -cZ /data2/backups/server_older.tar.gz /data2/backups/server/

I also tried

tar -cj /data2/backups/server_older.tar.gz /data2/backups/server/

But it just says "cannot stat" then it spits out a bunch of binary data.


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Red Squirrel
post Nov 7 2004, 07:18 PM
Post #7


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



I think I found a bug in the tar command, a huge buffer overflow at that.


CODE

[root@localhost root]# tar -c /data2/backups/test.tar.gz /data2/backups/server
tar: /data2/backups/test.tar.gz: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
data2/backups/server/0040755000000000000000000000000010143500435013504 5ustar  rootrootdata2/backups/server/databases/0040755000000000000000000000000010143501774015442 5ustar  rootrootdata2/backups/server/databases/mysql.sql0100644000000000000000044504000010143502154017325 0ustar  rootroot-- MySQL dump 9.10
--
-- Host: localhost    Database:
-- ------------------------------------------------------
-- Server version       4.0.18

--
-- Current Database: business
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ business;



There's no way this is normal. First off:

tar: /data2/backups/test.tar.gz: Cannot stat: No such file or directory

Obviously there's no file, the whole point of the command is to CREATE it.

And if it errors out, why does it start spitting out the data?

and this part is really weird.


data2/backups/server/0040755000000000000000000000000010143500435013504 5ustar rootrootdata2/backups/server/databases/0040755000000000000000000000000010143501774015442 5ustar rootrootdata2/backups/server/databases/mysql.sql0100644000000000000000044504000010143502154017325 0ustar rootroot-- MySQL dump 9.10


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
MadGhigno
post Nov 8 2004, 05:12 AM
Post #8


AF Newbie


Group: Members
Posts: 40
Joined: 3-August 04
From: Genoa, Italy
Member No.: 71
Gender: Male



if you want to compress the archive use:

CODE
tar -cvzf  /<the dir you want to archive>


to explode the archive:

CODE
tar -xvzf <archive_name.tgz>


bye
MadGhigno


--------------------
signature for rent
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Red Squirrel
post Nov 8 2004, 05:58 PM
Post #9


Merry Christmas!
*****

Group: Admin
Posts: 7 848
Joined: 24-June 04
From: Ontario Canada
Member No.: 4
Gender: Male



Thanks looks like I got it working, the f parameter has to be last.


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicTopic OptionsStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: