/disk/ana/data1 /disk/ana/data2 /disk/ana/data3 /disk/ana/data4 . .Suppose you do a tar from the ana directory as:
cd /disk/ana tar -cvf /dev/rmt/1mbn .and then later on want to recover only the data2 directory. You would read in the man page that the way to do that should be something like:
tar -xvf /dev/rmt/1mbn `tar -tf /dev/rmt/1mbn | grep 'data2/'`However, it there are many files and subdirectories with files in the data2 directory, this procedure will not work as the list of files gets too long to be handled, i.e., you are in trouble!
The way to do the backup is to keep the individual directories as separate files on the tar tape - by doing the tar as:
cd /disk/ana tar -cvf /dev/rmt/1mbn data1 tar -cvf /dev/rmt/1mbn data2 tar -cvf /dev/rmt/1mbn data3 tar -cvf /dev/rmt/1mbn data4 . .That way you can use the mt function to skip to the directory of interest as:
mt -f /dev/rmt/1mbn rew mt -f /dev/rmt/1mbn fsf 1(that would put you at the start of the second file on the tape). To do the recovery of the files:
cd /disk/ana tar -xvf /dev/rmt/1mbn
echo "tar -xvf /dev/rmt/1mbn \" >! tarext grep tl/src 950518.tape_tar | awk '{print $2 " \\"}' >> tarext chmod +x tarext