LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   best practice of huge directory into tar gz or bz2 (https://www.linuxquestions.org/questions/linux-newbie-8/best-practice-of-huge-directory-into-tar-gz-or-bz2-852414/)

salimshahzad 12-26-2010 02:09 AM

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

andrewthomas 12-26-2010 07:03 PM

Quote:

Originally Posted by salimshahzad (Post 4203194)
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.

John VV 12-26-2010 07:18 PM

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


All times are GMT -5. The time now is 03:04 AM.