1

I want to create an archive splitted on 300k archives but give me error

    tar -cf file.tar -k300 vi*       
tar: -k300: No such file or directory

I try to put -k before -c

tar -k 300 -cf file.tar vi* 
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...

tar -f file.tar -c -k 300  vi*            
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...

A workaround is to use gnu tar

gtar -cv --tape-length=300k --file=file-{0..10}.tar vi*       

But I want to know how to make this with Sun Tar

1 Answer 1

1

Solution found. As I understand -k option cannot work on regular files (works bad), need tape or floppy drive

In this example works for a tape and 13000 is 13000k of archive

tar -cvfk /dev/rmt/0 13000 bigfile

It will ask

tar: please insert new volume, then press RETURN.

Is also possible to use it on regular file on disk but it will create a strange "multiarchive file" which will include only the latest volume (every time you insert the new volume line it will overwrite the file "file.tar") instead of correct separate archive files

#ERROR
tar -cvfk file.tar 13000 bigfile

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.