PDA

View Full Version : Scripting ufsrestore


reaper
11-06-02, 01:14
I am trying to write a script for an unattended restore, however, now matter what I do, ufsrestore prompts for a volume number! Does anyone know how to pipe a response back in or any other way of getting around this.

The command I am using is;

ufsrestore xfs /dev/rmt/0hn 5 BATCHRES

I am trying to restore the folder and contents 'BATCHRES' to my current location. BATCHRES is on the 5th logigal tape, so I'm happy that is all correct, it's just that it prompts for a volume number!

Thanks in advance.

ladwig
11-06-02, 02:34
Hi,
if you try to give informations during running a shell for example:

ontape -a << eof

y
eof


This starts ontape -a and the next line just eob/enter
ontape the ask if tape is mounted
just a blank and return key answers
the next line y gives an answer for the next question
and eof the end

reaper
11-06-02, 02:37
Hi Juergen,

I tried that;

ufsrestore xfs /dev/rmt/0hn 5 BATCHRES << EOI
1
y
q
EOI


Didn't work! Still asked for input!

Thanks anyway.

ladwig
11-06-02, 02:48
[QUOTE][SIZE=1]Originally posted by reaper
Hi Reaper,

what is the last letter from EOI ?
Should be EOF .

WingMan
11-06-02, 12:09
How about ...

echo "My response" | ufsrestore xfs /dev/rmt/0hn 5 BATCHRES


??

reaper
11-06-02, 17:37
Hi Wingman,

Tried that to, still asks for input!

Thanks

reaper
11-06-02, 17:57
Originally posted by ladwig
[QUOTE][SIZE=1]Originally posted by reaper
Hi Reaper,

what is the last letter from EOI ?
Should be EOF .

Hi Ladwig,

Tried it with the 'F' (eof) instead of 'I' (eoi), still doesn't work.

Thanks

reaper
11-06-02, 19:17
Sorry Everyone! Discovered it was my impatience that was my downfall! The working script looks like this;

ufsrestore xfs /dev/rmt/0hn 5 BATCHRES << eof
1
y
q
eof

It just looks like its waiting for input. If you leave it long enough, the restore will complete and you will get the unix prompt back.

They say patience is a virtue, well maybe they were right!

Thanks all!