tar to tape and back

Howdy,

I'm trying to tar some directories to tape and then extract them from tape on another machine. I was hoping someone could help me with the syntax of the tar commands. Both machines are running Solaris 8.

Need to get all files and directories under the following:

 /opt/netscape/server4/docs
 /opt/coldfusion

\(some of the sub-directories are symbolic links, not sure if that matters\)

Once I have that data on tape, how would I extract it to the second machine?

thanks

pmetal

Hi there!!!
First of all, do you want to follow the links or not?

here are my suggestions:
to create your tape:

  • following the links
    cd /
    tar cpvhf `your_tape_device` ./opt/netscape/server4/docs ./opt/coldfusion
  • not following the links
    tar cpvf ./opt/netscape/server4/docs ./opt/coldfusion

Notice that the tar has been created relatively and not absolutely
Once the tape made, on your other system, you can do

  • tar tfv `your_tape_device` to visalize the archived files or
  • cd `your_pwd`;tar xpvf `your_tape_device` to extract your files !

As you can see, you might have to perform a `cd /` if you want your files to be at root...

Hope this will help!

Jason :smiley:

Hi,

Does anyone knows if I can delete the contents of a tape, or it has to be overwritten??

Thanks

Thanks Jason! I didn't realize the "h" would follow links, so that will definitely help in the future.

thanks again

pete

man tar would also provide you with a lot of information.

:slight_smile:

if you check man tar, there is not anything about deleting tar files from a tape. Any help would be appreciated ??
Can you erase the contents of a dat tape?

Thanks a lot

try the following command

mt -f /dev/rmt/0 erase

But this will erase the entire contents of the tape catridge
:slight_smile: