NCSA Home
Contact Us | Intranet | Search

UniTree, Tar and Tape


How can I restore a tar file from UniTree into my current directory?

    From an NCSA production machine:
    % msscmd 'get  filename.tar "|tar xf -"'
    

How can I save the contents of my current directory as a tar file on UniTree?

    From an NCSA production machine:
    % msscmd "tar cf  filename.tar ."
    

How can I extract one file from a tar file on UniTree?

    In UniTree issue the command:
    ftp> get  tarfile.tar "| tar xvf -  fileToExtract "
    
    From an NCSA production machine:
    % msscmd 'get  filename.tar  "|tar xvf -  fileToExtract "'
    

    Warning: The above command assumes that fileToExtract is in the top level directory of the tar file. If fileToExtract was in the directory abc in the tar file filename.tar then execute the command:

    % msscmd 'get filename.tar "|tar xvf -  abc/fileToExtract"'
    

    The above command will automatically create the directory abc, if it does not currently exist, and put the file fileToExtract in that directory.

How can I write a tar file in UniTree to tape without untarring the file on disk?

    In UniTree, issue the commands:
    ftp> binary
    ftp> get tarFile.tar "|dd of=/dev/rst0 obs=65536"
    

    The command above assumes there is a tape drive connected to your local workstation and that tape drive is connected to /dev/rst0. The file tarFile.tar will be piped into the unix utility "dd" (dd reads from stdin by default). Obs sets the block size to 64K, which is appropriate if you want to dump the tar file to exabyte tape. To read the tape, simply use tar.

    A side benefit to this method is that it doesn't consume any local disk space. If local disk space isn't a problem, ftp the file to a local workstation and then use 'dd' to move the file to tape.

How can I write a compressed tar file in UniTree to tape without uncompressing and untarring the file on disk?

    In UniTree, issue the commands:

    ftp> binary
    ftp> get tarFile.tar.Z "|zcat|dd of=/dev/nrst0 obs=65536"
    

    The command above assumes there is a tape drive connected to your local workstation and that that tape drive is connected to /dev/nrst0. The file tarFile.tar will be piped into the unix utility "dd" (dd reads from stdin by default). Obs sets the block size to 64K, which is appropriate if you want to dump the tar file to exabyte tape. To read the tape, simply use tar.

    A side benefit to this method is that it doesn't consume any local disk space. If local disk space isn't a problem, ftp the file to a local workstation and then use 'dd' to move the file to tape.