Re: Ontape -s , multiple tapes & cron.
Posted in 1998
Ken,
I like your idea very much but I need some comments to fully understand
it. I am posting it with MY comments for the benefit of the family.
Please fill the gaps and repost - I want to save this! (IMO it belongs
in the iiug archives!)
Kenneth Xu wrote:
>
> Oh, this is a good idea. I'm not sure about the expect-script you
> mentioned, but can we do this way:
>
> make a named pipe 'pipefile' and a shell script 'ontape_agent':
>
# filename: ontape_agent
read x # Read whatever comes into stdin and
# assume it is ontape asking the user
# to press RETURN to continue
ln -s /dev/rmt/0m /dev/ArchTape # Establish link for TAPEDEV device
echo # Simulate pressing RETURN
read x # Read STDIN again; same assumption
ln -s /dev/rmt/1m /dev/ArchTape # Bump TAPEDEV link to next tape drive
echo # Again, simulate pressing RETURN
> then we do this
sleep 100 >pipefile & # Duh.. What does this do for us?
#
# The pipeline below reads from the
# pipe, pipes its blank lines to
# ontape, propagating the simulated # RETURN key and sending ontape's
# prompts to the pipe file
ontape_agent <pipefile | ontape -s | tee pipefile
# Yes, it is circular, but so is I/O to
# any terminal.
> Jacob Salomon wrote in message <34C7D6BC.990E1A4A@garpac.com>...
> >
>>Here's how I distill your needs:
>>
>>1. Your TAPEDEV is a link like /dev/ArchTape, which is really a link
>> to anything you want it to be.
>>
>>2. You do not start ontape directly. You run it as an "expect" script.
>> Before running ontape, the expect-script sets the link
>> /dev/ArchTape to be /dev/rmt0.
>>
>>3. The script starts ontape and awaits the prompt to "press RETURN to
>> continue". When it gets the prompt, it simulates the key-press.
>>
>>4. When it receives the prompt to mount the next tape on /dev/ArchTape
>> and press RETURN when ready (I don't recall the exact wording) the
>> script switches the link to /dev/rmt1 and simulates the pressed
>> key.
--
-- Jake (Never yelled "CROWDED THEATER!" during a fire)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+