[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tar - explicit spanning



On Thu, Feb 01, 2001 at 10:04:31AM -0600, Adam Blomberg wrote:
> I'm trying to figure out how to use tar (preferrably with gzip) to create
> a tarball which creates a new file when each .tar (or better yet, each
> tar.gz) reaches a size of 2.2 Gbytes.  
> 
> Essentially, I want to archive a large directory into 2.2 Gbyte tarballs
> which are "spanning" in nature.  I have an 18 Gbyte directory tree that I
> want to compress into a set of 2.2 Gbyte archives so that I can copy the
> individual tarballs onto separate DVD-RAM media later.  It appears that
> the -M (multple) flag only works properly when you actually run out of
> space on the medium you are archiving to.  Is there a way to force tar to
> create iterative files in a specified size?
> 
> Thus far, I haven't figured it out from the man pages, nor from a number
> of 'net searches of list archives.  If anybody knows the proper arguments
> to achieve this, please let me know.  I absolutely refuse to use windows
> to perform this spanning archive process, as I am trying to work solely in
> GNU/Linux.

I was looking through the manpages when I realized there's another way
to do this.  You lose the ability to recover from tarfile errors, but
I presume you're willing to risk that since you were planning on
using gzip anyway ...

  tar cf - dir | gzip -9 | split --bytes=2252m

This should create 2.2 G files named "xaa", "xab", "xac" ... which,
when joined, will be a compressed tar file.

Cheers,

-- 
Nathan Norman - Staff Engineer | A good plan today is better
Micromuse Inc.                 | than a perfect plan tomorrow.
mailto:nnorman@micromuse.com   |   -- Patton

Attachment: pgphPJLwW0lHp.pgp
Description: PGP signature


Reply to: