LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2008, 02:24 AM   #1
mefman
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
Package Folder into Multiple tar files???


i have a linux server running CentOS. i currently use the command:
tar -cvf foldername.tar foldername/
to tar a folder, but i would like to be able to make folder that are over 100mb in size tar into multiple tar files no bigger then 100mb. so if a folder is 350mb, split it into 3 x 100mb tar's and 1 x 50mb tar. i know how to use the "split" command, but i cant use that if i download to a windows pc and try to unzip it, as i need it for people who use winrar/etc to unpack files.

so in short...any ideas of way to tar the folder into filename.part1.tar, filename.part2.tar, etc???? so it can be unrar'd in windows?

thanks in advance
 
Old 03-30-2008, 02:42 AM   #2
jakykong
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101

Rep: Reputation: 15
Well, you can't unrar a tar file -- i think what you mean is to untar it?

Semantics aside, splitting and combining files in linux is fairly easy -- just use the split command to make bite-sized chunks of your file, and then cat them together again.

Split is easy enough, you're already in linux when you make the tar (presumably). So you just need to cat them together again in windows...
http://unxutils.sourceforge.net/ has a cat.exe utility. I would have to poke around a bit more to find a way to redirect that input into a file in windows (you may be better off with something like http://www.steve.org.uk/Software/bash/, a windows port of the bash shell, and then use the cat.exe tool from there to redirect it all into files).

I know this is kind of a kludge, but at the moment it's the only thing I can think of.

Hope it helps!

by the way... to open a .tar file in windows, use http://gnuwin32.sourceforge.net/packages/gtar.htm, or perhaps http://www.zipgenius.it/eng/index.php (both linked from wikipedia's page on tar ). The rar program probably won't do it (although I haven't used windows in a long time, so that may have changed).

Last edited by jakykong; 03-30-2008 at 02:43 AM.
 
Old 03-30-2008, 03:32 AM   #3
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
You can use 7zip to untar files in windows
 
Old 03-30-2008, 03:38 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by jakykong View Post
Split is easy enough, you're already in linux when you make the tar (presumably). So you just need to cat them together again in windows...
Indeed there are plenty free softwares to "split and merge" files in Windows. Also a simple dos command should do the job:
Code:
copy /b splitted_files.* joined_file.tar /b
You should only instruct windows people to use the command line. This could be the most difficult task!

Regarding the untar of unix archives, a lot of windows applications can manage them now, including the most popular winzip and winrar and some free software.
 
Old 03-30-2008, 12:57 PM   #5
jakykong
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101

Rep: Reputation: 15
Quote:
Originally Posted by colucix View Post
Indeed there are plenty free softwares to "split and merge" files in Windows. Also a simple dos command should do the job:
Code:
copy /b splitted_files.* joined_file.tar /b
You should only instruct windows people to use the command line. This could be the most difficult task!

Regarding the untar of unix archives, a lot of windows applications can manage them now, including the most popular winzip and winrar and some free software.
Good to know .

Last time I used windows to do anything (I've fixed them since, and earned my A+ for it, but that doesn't really cover this sort of thing.), was a LONG time ago. I don't know, a year or two at least. I pretty much went linux cold turkey after a short time dual-booting.

Apparently things have changed a bit since I was using it. Thanks for the update.

P.S. I didn't think the windows command line would be powerful enough to do much with the split archive . I figured an external program would be pretty much required once you split the file.
 
Old 03-31-2008, 12:36 AM   #6
mefman
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
well all those suggestions are good and easy if it was just me using the files, but it needs to be easy for others on windows to do it, without needing extra programs if they already have winrar or some other unrar'ing program. i already use "split" but need it to be like in windows when u rar a file and split it into 50mb files, u can just unrar the start file and it does them all.

colucix, yeah it would be easy if i could get others to use the cmd line but the world is full of lazy people lol

thnx 4 replies
 
Old 03-31-2008, 12:59 AM   #7
jakykong
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101

Rep: Reputation: 15
What if you were to rar it in windows, using winrar?

I don't know exactly how the rar format deals with split archives; but if you want a split rar archive, it might be better just to use rar to split the archive .

If getting the files over to windows is a problem, we can certainly help with that.
 
Old 03-31-2008, 08:46 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
jakykong, you hit the nail on the head! You can create the tar archive as usual. Then compress it using rar and splitting in pieces of the desired size. For example, suppose you want to compress a tar archive and split it into 10 Mbytes parts:
Code:
rar a -v10000k pippo file.tar
this will compress the archive file.tar and split it as
Code:
pippo.part1.rar
pippo.part2.rar
pippo.part3.rar
...
If you transfer the pieces on a Windows machine and double-click on the first part, winrar will take care of join the parts together and extract the tar archive. Then you can extract the archive in the usual way, since winrar can manage the tar format as well.
 
Old 03-31-2008, 08:57 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by mefman View Post
colucix, yeah it would be easy if i could get others to use the cmd line but the world is full of lazy people lol
Yeah... I know! But if you use the method suggested in the posts above, it's up to you to instruct lazy people to do a simple double-click on the right icon!
 
Old 04-01-2008, 05:38 AM   #10
mefman
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
jakykong, you hit the nail on the head! You can create the tar archive as usual. Then compress it using rar and splitting in pieces of the desired size. For example, suppose you want to compress a tar archive and split it into 10 Mbytes parts:
Code:
rar a -v10000k pippo file.tar
this will compress the archive file.tar and split it as
Code:
pippo.part1.rar
pippo.part2.rar
pippo.part3.rar
...
If you transfer the pieces on a Windows machine and double-click on the first part, winrar will take care of join the parts together and extract the tar archive. Then you can extract the archive in the usual way, since winrar can manage the tar format as well.


awesome, works a treat. thnx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unzip multiple zip files, each to separate folder smart_sagittari Linux - Newbie 3 03-21-2012 08:41 AM
tar multiple folders and files at once sinister1 Linux - General 4 12-10-2007 02:49 AM
how-to: tar -zxvf multiple files at once stevesk Linux - Newbie 3 02-15-2006 08:59 AM
extracting multiple files with tar -xjvf logicalfuzz Linux - Software 3 11-06-2005 01:21 AM
unpacking multiple .tar.gz files illtbagu Linux - General 5 01-18-2003 05:43 PM


All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration