From: <gl...@ma...> - 2001-07-25 03:38:48
|
> > > Since you're interested, this is the guts of what I am trying to do: > > > > spawn("rsh machine dump_cmd various args... mount-point |cat -|dd bs=64k of=tape-device"); > > > > then use expect to catch the message: > > "End of tape reached. Press RETURN when new tape loaded ..." > > (message varies depending on the dump software - yes, I'm doing this > > from multiple machines/OSes/dump commands, each with different > > idiosyncrasies, arguments, etc...) > > > > When I get the expect message, I call a sub to change tapes using the > > tape robot. That's the plan anyway. :) > > Oh, OK, that's a perfectly valid use for Expect... :-) > > BTW, what's the use of that noop-cat inside that pipe? 'dd' already does > all the buffering you need... No, unfortunately not. After a great deal of experimenting, we found we needed to do this to get the blocking right. Something to do with buffering and rsh lags perhaps? > Good luck with that project! Thanks. Believe me, I need it! I tried the change to the exec in Expect. Didn't help. Currently I am getting this: Reached end of medium for /dev/nrmt1h; Please wait for file closing Cannot prompt (can't open /dev/tty): No such device or address expect is catching the "Press RETURN ..." message, and happily changing tapes, but the print $bakupcmdobj "\r"; which I do after the tape is ready is evidently failing. The script just hangs - I see this: # ps -fu root | grep ... root 3661 198 0.0 - ?? 0:00.00 <defunct> root 198 12213 0.0 11:14:41 ttyra 0:00.38 perl /usr/local/sbin/bakup_master .... Any thoughts? thanks Glen -- Glen Davison gl...@ma... Computer System Administrator phone: +61 2 9385 7018 Maths, UNSW fax: +61 2 9385 7123 |