From c44199a547a3c66b23851b5f0b2831d2c4552ef8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 8 Jun 2004 19:09:53 +0000 Subject: [PATCH] Final changes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1398 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/scripts/mtx-changer.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bacula/scripts/mtx-changer.in b/bacula/scripts/mtx-changer.in index 3760cae748..f25467d434 100644 --- a/bacula/scripts/mtx-changer.in +++ b/bacula/scripts/mtx-changer.in @@ -29,6 +29,14 @@ MTX=@MTX@ +wait_for_drive() { + while ! mt -f $1 status >/dev/null 2>&1; do +# echo "Device $1 - not ready, retrying..." + sleep 5 + done +} + + if test $# -lt 2 ; then echo "usage: mtx-changer ctl-device command slot archive-device drive" echo " Insufficient number of arguments arguments given." @@ -90,6 +98,8 @@ case $cmd in rtn=$? # # Increase the sleep time if you have a slow device +# or remove the sleep and add the following: +# wait_for_drive $device sleep 15 exit $rtn ;; -- 2.39.5