March 2nd, 2007, 01:38 PM
-
Creating multivolume tar files with incrementing name?
Hi all,
I've got a large directory and I want to tar it creating multi volume archives with incrementing numbers.
However my tar file is constantly overwritten. I am doing something wrong, but I don't know where to add the incrementing number. or howto...
this is my tar line:
Code:
tar -cf test_backup.tar -M -L 912000 /dir_to_tar/ -R -p
So how should it look like?
March 2nd, 2007, 09:02 PM
-
Unless you want something more complex, the best would be to add the date to the file name:
Code:
tar -cf test_backup_`date +%Y%m%d`.tar /dir_to_tar/
PS: I removed bogus options.
March 4th, 2007, 10:30 AM
-
Originally Posted by LKBrwn_DBA
Unless you want something more complex, the best would be to add the date to the file name:
Code:
tar -cf test_backup_`date +%Y%m%d`.tar /dir_to_tar/
PS: I removed bogus options.
Thanks for the reply. The problem is: The dir I want to archive has about 3 gigs of content. The system is configured to allow files no larger than 1 gig. So I want to archive the whole directoy creating multi volume files from it.
Therefore I used -L 912000. But I need to add some kind of incrementing number else the archive will be overwritten again and again.
March 5th, 2007, 11:21 AM
-
OK, then use the 'split' command:
Code:
tar -cf - /dir_to_tar/|split -b 2000m - test_backup_`date +%Y%m%d`.tar.
#--Or just:
tar -cf - /dir_to_tar/|split -b 2000m - test_backup.tar.
March 5th, 2007, 05:06 PM
-
Originally Posted by LKBrwn_DBA
OK, then use the 'split' command:
Code:
tar -cf - /dir_to_tar/|split -b 2000m - test_backup_`date +%Y%m%d`.tar.
#--Or just:
tar -cf - /dir_to_tar/|split -b 2000m - test_backup.tar.
hmmm me dumb...
still ain't working...
there is no option called split and there is no option with b...
I only got the -M option for multi archive and the manual says:
-M
--multi-volume Create/list/extract multi-volume archive.
-n
--norecurse Don't recurse into subdirectories when creating.
--volno-file file File name with volume number to start with.
But I don't get it to work...
March 6th, 2007, 12:36 PM
-
split and -b are NOT options for tar, split is a separate command and -b is an option for split.
In the example I posted there is a "pipe" (|) between the tar and the split commands.
March 6th, 2007, 03:20 PM
-
Originally Posted by LKBrwn_DBA
split and -b are NOT options for tar, split is a separate command and -b is an option for split.
In the example I posted there is a "pipe" (|) between the tar and the split commands.
like I said... I am dumb. 
anyways... the problem I have is: (which I have already noted)
The dir I want to archive has about 3 gigs of content. The system is configured to allow files no larger than 1 gig.
Since the archive gets larger than the 1 GB it simply won't work with split...
well, I'll have to call the support to remove this ridiculous file limit... otherwise it won't probably work...
Thanks anyway for your help!
March 6th, 2007, 03:59 PM
-
The "-b 2000m" option in split will create files not larger than 2000 Megabytes ( < 2 GIG)
Did you try this command?:
Code:
tar -cf - /dir_to_tar/ | split -b 2000m - test_backup.tar.
PS: To create files not larger than 1 Gig use -b 1000m option.
Last edited by LKBrwn_DBA; March 7th, 2007 at 11:27 AM.
March 7th, 2007, 05:22 PM
-
Originally Posted by LKBrwn_DBA
The "-b 2000m" option in split will create files not larger than 2000 Megabytes ( < 2 GIG)
Did you try this command?:
Code:
tar -cf - /dir_to_tar/ | split -b 2000m - test_backup.tar.
PS: To create files not larger than 1 Gig use -b 1000m option.
It worked!!!! thanks a lot! maybe i just misspelled something or so! Works like a charm now!
Thanks again!
March 12th, 2007, 08:28 PM
-
just for the dumb me... how do I extract those multi volume archives?
I tried: tar -xfm volume.tar.aa
But well... it didn't work again... :/