LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2010, 03:09 AM   #1
salimshahzad
Member
 
Registered: Dec 2009
Posts: 200

Rep: Reputation: 15
best practice of huge directory into tar gz or bz2


hello

suggest or advise the best practice of bz2 or tar gz. i have a directory /var/opt/axigen which has size 33gb on daily basis as per the schedule we need to take back.

i want to know pros and crons of below commands, say best compression and decompress

tar cvzf /var/opt/bkup_axigen/axigen_bkup_1.tar.gz /var/opt/axigen

or

tar -jvzf9 /var/opt/bkup_axigen/axigen_bkup_1.tar.gz /var/opt/axigen

kind regards
 
Old 12-26-2010, 08:03 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by salimshahzad View Post
hello

suggest or advise the best practice of bz2 or tar gz. i have a directory /var/opt/axigen which has size 33gb on daily basis as per the schedule we need to take back.

i want to know pros and crons of below commands, say best compression and decompress

tar cvzf /var/opt/bkup_axigen/axigen_bkup_1.tar.gz /var/opt/axigen

or

tar -jvzf9 /var/opt/bkup_axigen/axigen_bkup_1.tar.gz /var/opt/axigen

kind regards
I think that you are missing an - in the first and have the wrong file extention


tar -cvzf /var/opt/bkup_axigen/axigen_bkup_1.tar.bz2 /var/opt/axigen


As for the second, I am unfamilar with the 9 (may be a typo)


tar -jvzf /var/opt/bkup_axigen/axigen_bkup_1.tar.gz /var/opt/axigen


I would read the man page for tar or http://linux.die.net/man/1/tar

I believe that bz2 would create a smaller archive, but it may be slower than gz.
 
Old 12-26-2010, 08:18 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
if time is of no importance then use the bz2 . but it is very slow but will make the smallest size archive ( very slow)
now a much faster ( an a slightly bigger archive) format might be to use the *.xz compression
Code:
man xz
take a 1 gig file and test the size /vs time
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install tar.gz & tar.bz2 file on Linux min Krishnendu Linux Mint 2 07-16-2009 07:52 AM
Piping tar bzcat to add a file to a tar.bz2 archive DaveQB Linux - Software 0 06-02-2008 09:28 PM
tar-command not found while compiling glibc-libidn-2.7.tar.bz2 of lfs6.3 aditya_gpch Linux From Scratch 1 05-14-2008 12:27 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 02:04 PM


All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration