HOWTO archive files to the tape library

From GlueXWiki
Jump to: navigation, search

The first script is an example of archiving files to the tape library. This script assumes

  1. you are logged into an ifarm machine
  2. there is a local directory called test
  3. that directory contains a set of files (and perhaps other directories) that should be archived
  4. that the archive should be stored in the user's home directory in the tape library "directory" structure

The directory is tar'ed up and archived.

#!/bin/sh
username=marki
mssdir=/mss/home/$username/testdir/
directory=test
####
tar zcvf $directory.tar.gz $directory
jput $directory.tar.gz $mssdir
exit

Notes:

  1. You must wait for the jput to exit before closing the shell session. If the jput is ended before completion, the transfer to the tape library will be cancelled.
  2. The jput may take a while. You are getting into a queue with all of the other tape users.

The next script restores the files saved in the previous example.

#!/bin/sh
username=marki
mssdir=/mss/home/$username/testdir/
directory=test
####
jget $mssdir/$directory.tar.gz $directory.tar.gz
tar zxvf $directory.tar.gz
exit

Notes:

  1. The restored test directory will appear in the local directory.
  2. Again patience is required.

To see the status of any tape request (jput or jget) use the jtstat command.