LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 02: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, 07:03 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
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, 07:18 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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



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 06:52 AM
Piping tar bzcat to add a file to a tar.bz2 archive DaveQB Linux - Software 0 06-02-2008 08:28 PM
tar-command not found while compiling glibc-libidn-2.7.tar.bz2 of lfs6.3 aditya_gpch Linux From Scratch 1 05-13-2008 11:27 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 PM.

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
Open Source Consulting | Domain Registration