Hello,

I am having trouble finding information on how to detect a busy SCSI tape device in Bash.

I have tried putting a 'mt -f /dev/st0 status' between the two 'tar' commands, I don't want to use sleep as the first 'tar' is an indefinite time and I don't want one big 'tar' or to use 'tar cvf /dev/nst0 /home /data' because I want the separate log files.

I am looking something like ...

if not (tape busy)                   <--- how to do in Bash?
        LOG$=$(date %y%m%d)-Home
        SRCD='/home/'
        TGCD='/dev/nst0'
        tar -cvf $TGCD $SRCD | tee /var/logs/tape/$LOG
fi

Which can be repeated in the script changing the variables etc. I am not a programmer, just in case that had slipped by :-)

Regards,

-----------------------------------------------------------------------------
Mike Earnshaw      | "The  lyf  so  short,  the  craft  so  long  to  lerne"
Systems Support   |  
  Engineer        |                         --Chaucer  
-----------------------------------------------------------------------------
  ,-._|\    Union Switch & Signal
 /      \   24 Bannick Court
 *_.--._/   Canning Vale, WA 6155, Western Australia
       v    Tel : +61 8 9256 0020  Fax : +61 8 9256 1199   Mob: 0418 956 250
-----------------------------------------------------------------------------

Reply via email to