You are not logged in.

#1 2008-11-15 20:18:49

pinchyfingers
Member
From: Bristol, PA
Registered: 2008-11-04
Posts: 46
Website

Is there a way to predict the size of a gzipped tarball

I am trying to write a backup script that will create gzipped tarballs that will fit on a CD.

Maybe I am approaching this from the wrong direction, any advice is much appreciated.

Offline

#2 2008-11-15 20:24:43

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Is there a way to predict the size of a gzipped tarball

There is no easy predictor. If the source data is text, it will compress amazingly well. If it is an already compressed format, like video, you may end up with a larger file than the original.

You can always make the tarball, and then see how big it is..if it is too large to fit on a single CD, maybe consider DVDs, or use a file splitter so your tar can span more than one CD.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2008-11-15 20:27:04

Arkane
Member
From: Switzerland
Registered: 2008-02-18
Posts: 263

Re: Is there a way to predict the size of a gzipped tarball

I think gzipping the whole lot without thinking too much and then splitting it is probably the easiest option.


What does not kill you will hurt a lot.

Offline

#4 2008-11-15 20:37:29

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Is there a way to predict the size of a gzipped tarball

Wouldn't it be easier to use `split`; or replace gzip with a compression algorithm that supports splitting, such as 7z or rar?

Offline

#5 2008-11-15 20:46:15

pinchyfingers
Member
From: Bristol, PA
Registered: 2008-11-04
Posts: 46
Website

Re: Is there a way to predict the size of a gzipped tarball

Excellent. Thank you guys. I knew there had to be an eaiser way.

Offline

#6 2008-11-24 20:15:13

xen
Member
Registered: 2008-08-17
Posts: 56

Re: Is there a way to predict the size of a gzipped tarball

http://chxo.com/be2/tar_backup_to_ntfs.html

Someone in IRC pointed me to this (sorry, can't remember who!). Obviously you will want to change the split size from 1M to the size of a CD, or DVD. You can also remove the incremental flag, unless you want it!


A wannabe game-developer.
My Blog
My GitHub

Offline

Board footer

Powered by FluxBB