Good afternoon gentlemen...I'm writing a backup shell script on Fedora Linux server. The purpose of the script is back-up weekly files to an internal tape drive. I have everything execpt when the tape is finished at the recording, I need to develop an if statement so that when it reaches the end of the tape it will eject the tape and send a message to the administrator that the tape has been ejected. I have a sample script below, but the if statement is the one I need help with, what do I use to specify the tape is at the end, is it 0. Script below
find . print | cpio -ovH crc -O /dev/nst0
if ( $tape_drive = ????)
mail "tape is finished" > admin@localhost
mail "date% this weeks backup is complete" > admin@localhost
any modifications will be welcomed.