Results 1 to 5 of 5
-
11-09-2005, 05:17 PM #1Junior Guru Wannabe
- Join Date
- Sep 2001
- Posts
- 46
tarring up a folder into different pieces?
I would like to know if it's possible to tar up a folder into different pieces, like for example if a folder contains up to 20gb in size and I would like to tar it up and split into individual 2gb in size each. If so how do we untar it those individual pieces again? Thanks!
-
11-09-2005, 05:36 PM #2New Member
- Join Date
- Nov 2005
- Location
- Los Angeles, CA
- Posts
- 4
tar cvfz - will give you a tar.gz
split -b 2m - will split your tar.gz into 2mb chunks
cat [ordered list of splits] > .tar.gz - will reassemble the chunks from split
tar xvfz - untar
-
11-09-2005, 05:47 PM #3Junior Guru Wannabe
- Join Date
- Sep 2001
- Posts
- 46
so if it's into gb then i just use split -b 2gb ?
-
11-09-2005, 07:21 PM #4Web Hosting Master
- Join Date
- Dec 2004
- Location
- Canada
- Posts
- 1,097
The -b flag's options only go up to m. Just multiply by 1000 for gigs.
It would probably be more efficient to do it with a pipe; disk I/O is slow, so to get rid of the intermediate file:
To create:
Code:tar zcv directory | split -b2000m
Code:cat x* | tar zxv
-
11-09-2005, 08:00 PM #5Junior Guru Wannabe
- Join Date
- Sep 2001
- Posts
- 46
thanks alot for the pointers!