LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-07-2005, 01:54 AM   #1
242VDM242
LQ Newbie
 
Registered: Nov 2004
Location: FRANCE
Distribution: Red Hat 9
Posts: 13

Rep: Reputation: 0
Help needed to split files


In order to backup large data archives I was wondering if there is a command that allows to split a big file into several smaller chunks of specified sizes.
for example to backup
 
Old 04-07-2005, 01:57 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

Code:
man split
to define size per file, you should use the parameter "-b"

regards

slackie1000
 
Old 04-07-2005, 02:02 AM   #3
242VDM242
LQ Newbie
 
Registered: Nov 2004
Location: FRANCE
Distribution: Red Hat 9
Posts: 13

Original Poster
Rep: Reputation: 0
... continued (sorry my fingers are too big for this keyboard...)

For example to backup a big archive .tar.gz (> 10Go) into several chunks that could be burned on DVDs ?


The other solution for me would be to specify the chunks sizes before creating the archive, I have a folder containing several thousands of files that I compress using a "tar -czvf command". Can I at this time specify that I want several archive files of given sizes ?

Thanks for your help
 
Old 04-07-2005, 02:35 AM   #4
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

you can use split to divide the big file according to your wish
Code:
split -b $DVD_SIZE $YOUR_FILE
should work.

regards

slackie1000
 
Old 04-07-2005, 03:01 AM   #5
242VDM242
LQ Newbie
 
Registered: Nov 2004
Location: FRANCE
Distribution: Red Hat 9
Posts: 13

Original Poster
Rep: Reputation: 0
Hi,
Thanks it works !

Split filename -b filesize

A naive question : several files are created, now no problem to backup them but the day I want to unsplit those files how do I proceed ? Shall I simply double click on the first one ?
 
Old 04-07-2005, 03:04 AM   #6
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

welcome, mate!
you can use
Code:
cat
and merge back all of them.

glad to help!

regards

slackie1000
 
Old 04-07-2005, 04:01 AM   #7
242VDM242
LQ Newbie
 
Registered: Nov 2004
Location: FRANCE
Distribution: Red Hat 9
Posts: 13

Original Poster
Rep: Reputation: 0
I made a test on a small file (40Mo) that I splitted into 2 files. When in the directory of these 2 files I use simply the command "cat" nothing happen. When I do :

cat file1 file2

no 'final' file is created, the concatenation scroll on the screen

...
 
Old 04-07-2005, 04:06 AM   #8
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

so you do
Code:
cat file1 file2 > output.file
and it is done.

with a lot of files, should be better a shell script.

regards

slackie1000
 
Old 04-07-2005, 04:19 AM   #9
242VDM242
LQ Newbie
 
Registered: Nov 2004
Location: FRANCE
Distribution: Red Hat 9
Posts: 13

Original Poster
Rep: Reputation: 0
Many thanks for your precious help, I finally can do what I want ...

Regards,
 
Old 04-07-2005, 08:37 AM   #10
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
You could try DAR (see my sig) which allows you to perform a compressed backup (using gzip or bzip2 algorithms) splitted in several files with sizes of your choice. It also has many other handy features, even a backup manager.
 
Old 04-07-2005, 09:39 AM   #11
mcosta
Member
 
Registered: Jan 2005
Location: Spain
Distribution: Debian
Posts: 44

Rep: Reputation: 16
I told you in the other related thread. To get good and quick answers, you must make good questions. I am not blaming you, just telling we have not learned to read minds. You should explain the problem and what you want precisely.

Now you know you can split files with the 'split' command. Just read 'man split' to know how to use it. Then you save your and our time.

To join all:
1 - Enter 1st dvd
2 - Copy the file, ie: /my_big_file.tar.gz
3 - Enter next dvd
4 - cat /media/dvd/my_big_file.* >> /my_big_file.tar.gz
5 - goto 3

The >> appends to the end of the file. > overwrites.
 
  


Reply



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
dd question - split files Sn7 Linux - Software 5 08-30-2009 04:42 AM
how to split up audio files? SciYro Linux - General 3 10-27-2004 11:25 AM
dd question - split files Sn7 Linux - General 1 09-19-2004 10:15 AM
How to rejoin split files SharpyWarpy Linux - General 2 02-07-2003 02:42 PM
What is there to split up wav files? J_Szucs Linux - Newbie 10 12-28-2002 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:04 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
Open Source Consulting | Domain Registration