NCSA Home
Contact Us | Intranet | Search

ncsa

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.

My files are not in tar format in UniTree. How can I save my files to a tape drive on a local workstation?

    This procedure costs nothing but may require some effort on your part. The procedure assumes your files are NOT already in tar format and that you wish to ftp files to disk on a local machine and then save the files to tape. If your files are already in tar format, please cf other question ("How can I write a tar file in UniTree to tape without untarring the file on disk?)
    1. Stage Relevant Files in UniTree

      Staging Unitree Files FAQ question #1

    2. Put "msscmd" on your Local Machine

      Unitree Tricks FAQ question #6

    3. Bring Files from UniTree to Disk

      Get all your files off of UniTree in two commands. The first command creates your UniTree directory structure on disk:

      Unitree Tricks FAQ question #7

      and the second command gets all your files from UniTree

      Unitree Tricks FAQ question #8

    4. Write the Tar File to Tape

      Find a machine attached to a tape drive and write the tar file to tape.