erase_tl4000.sh 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. : '
  3. lsscsi -g
  4. [0:0:0:0] tape IBM ULT3580-HH5 BBNF /dev/st0 /dev/sg8
  5. [0:0:0:1] mediumx IBM 3573-TL B.20 /dev/sch0 /dev/sg9
  6. [0:0:1:0] tape IBM ULT3580-HH5 BBNF /dev/st1 /dev/sg10
  7. mtx -f /dev/sg9 status
  8. Storage Changer /dev/sg9:2 Drives, 48 Slots ( 3 Import/Export )
  9. Data Transfer Element 0:Empty
  10. Data Transfer Element 1:Empty
  11. Storage Element 1:Full :VolumeTag=000001L5
  12. Storage Element 2:Full :VolumeTag=000002L5
  13. Storage Element 3:Full :VolumeTag=000003L5
  14. Storage Element 4:Full :VolumeTag=000004L5
  15. Storage Element 5:Full :VolumeTag=000005L5
  16. Storage Element 6:Full :VolumeTag=000006L5
  17. Storage Element 7:Full :VolumeTag=000007L5
  18. Storage Element 8:Full :VolumeTag=000008L5
  19. Storage Element 9:Full :VolumeTag=000009L5
  20. Storage Element 10:Full :VolumeTag=000010L5
  21. Storage Element 11:Full :VolumeTag=000011L5
  22. Storage Element 12:Full :VolumeTag=000012L5
  23. Storage Element 13:Full :VolumeTag=000013L5
  24. Storage Element 14:Full :VolumeTag=000014L5
  25. Storage Element 15:Full :VolumeTag=000015L5
  26. Storage Element 16:Full :VolumeTag=000016L5
  27. Storage Element 17:Full :VolumeTag=000017L5
  28. Storage Element 18:Full :VolumeTag=000018L5
  29. Storage Element 19:Full :VolumeTag=000019L5
  30. Storage Element 20:Full :VolumeTag=000020L5
  31. Storage Element 21:Full :VolumeTag=000045L5
  32. Storage Element 22:Full :VolumeTag=000022L5
  33. Storage Element 23:Full :VolumeTag=000023L5
  34. Storage Element 24:Full :VolumeTag=000024L5
  35. Storage Element 25:Full :VolumeTag=000025L5
  36. Storage Element 26:Full :VolumeTag=000026L5
  37. Storage Element 27:Full :VolumeTag=000027L5
  38. Storage Element 28:Full :VolumeTag=000028L5
  39. Storage Element 29:Full :VolumeTag=000029L5
  40. Storage Element 30:Full :VolumeTag=000030L5
  41. Storage Element 31:Full :VolumeTag=000031L5
  42. Storage Element 32:Full :VolumeTag=000046L5
  43. Storage Element 33:Full :VolumeTag=000033L5
  44. Storage Element 34:Full :VolumeTag=000034L5
  45. Storage Element 35:Full :VolumeTag=000035L5
  46. Storage Element 36:Full :VolumeTag=000036L5
  47. Storage Element 37:Full :VolumeTag=000037L5
  48. Storage Element 38:Full :VolumeTag=000038L5
  49. Storage Element 39:Full :VolumeTag=000039L5
  50. Storage Element 40:Full :VolumeTag=000040L5
  51. Storage Element 41:Full :VolumeTag=000041L5
  52. Storage Element 42:Full :VolumeTag=000042L5
  53. Storage Element 43:Full :VolumeTag=000043L5
  54. Storage Element 44:Full :VolumeTag=000044L5
  55. Storage Element 45:Full :VolumeTag=CLNU00L1
  56. Storage Element 46 IMPORT/EXPORT:Empty
  57. Storage Element 47 IMPORT/EXPORT:Empty
  58. Storage Element 48 IMPORT/EXPORT:Empty
  59. '
  60. logfile=/home/thierry/$0.log
  61. rm $logfile
  62. echo "start Erase Script @ $(date)" >> $logfile
  63. i="1"
  64. while [ $i -lt 44 ]
  65. do
  66. echo "---------------------------------------------------------------" >> $logfile
  67. echo "load and erase tape's $i & $[$i+1] "$(date) >> $logfile
  68. mtx -f /dev/sg9 load $i "0" >> $logfile
  69. mtx -f /dev/sg9 load $[$i+1] 1 >> $logfile
  70. echo "erase drive0 tape $i" >> $logfile
  71. mt -f /dev/st0 erase >> $logfile &
  72. echo "erase drive0 tape $[$i+1]" >> $logfile
  73. mt -f /dev/st1 erase >> $logfile
  74. wait
  75. mtx -f /dev/sg9 unload $i "0" >> $logfile
  76. mtx -f /dev/sg9 unload $[$i+1] 1 >> $logfile
  77. i=$[$i+2]
  78. done
  79. echo "done Erasing 44 tapes script @ $(date)" >> $logfile
  80. exit