Split files with tar

Topic: 

I have a huge 500MB size tar file to upload. and It's took many hour estimate time.
I wish to split to files like mysqldump. The solution is split files with tar.

tar -cML 51200 -f files.tar large_file

-c, --create create a new archive
-L, --tape-length=NUMBER change tape after writing NUMBER x 1024 bytes
-M, --multi-volume create/list/extract multi-volume archive

Tar will asks you to change the volume with a question like.

Prepare volume #2 for "files.tar' and hit return: you just type "n filename" to give a new file name for the next (and subsequent) volume(s) like this. Prepare volume #2 for "files.tar' and hit return: n files_2.tar
Prepare volume #3 for "files_2.tar' and hit return: n files_3.tar
Prepare volume #4 for "files_3.tar' and hit return: n files_4.tar

** Do Not enter with no filename coz it will overwrite your file with last file name.
** volume #X must relate with file name (Prepare volume #4 you must enter n file_4.tar)

How to keep It back?

just use command below and enter your file name in the same way from compress process.

tar -xM -f files.tar Done!!

1 comment

Carol's picture
by Carol
on 5 March 2010 - 2:40pm

Any way to pass the extra file name info into the command so you don't have to sit there typing in the new file names every 1.2GB?
research paper

Post new comment

© 2010 Pangpond.. Theme by Kiwi Themes.