GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: guru help needed for script
Operating System - HP-UX
1846964
Members
4350
Online
110257
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2002 10:26 AM
04-30-2002 10:26 AM
Hi All,
I wrote a script for backup, what the script is doing right now is if any arguments is missing It will exit, but since another program calling this script I don't want the to exit at any stage, rather i'll wait and the input. If the tape is not there it give a message and wait till the some put the tape in the drive and script is keep running in a loop. Can anyone put light here
I wrote a script for backup, what the script is doing right now is if any arguments is missing It will exit, but since another program calling this script I don't want the to exit at any stage, rather i'll wait and the input. If the tape is not there it give a message and wait till the some put the tape in the drive and script is keep running in a loop. Can anyone put light here
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2002 12:15 PM
04-30-2002 12:15 PM
Solution
Anthony,
take this code:
# Checking if device is given
if [ -z "$DEVICE" ]
then
echo $MESSAGE1
echo $MESSAGE2
exit 1
else
mt -t "$DEVICE" rew
fi
if [ $? -ne 0 ]
then
echo "There is no tape"
else
echo " Tape is loaded."
fi
and replace it with this:
##############################
# Checking if device is given
if [ -z "$DEVICE" ]
then
echo $MESSAGE1
echo $MESSAGE2
exit 1
fi
mt -t "$DEVICE" rew
TAPEISLOADED=$?
while [ "$TAPEISLOADED" != "0" ]
do
echo "There is no tape"
# send an email here to notify someone
sleep 60
mt -t "$DEVICE" rew
TAPEISLOADED=$?
done
echo " Tape is loaded."
##############################
live free or die
harry
take this code:
# Checking if device is given
if [ -z "$DEVICE" ]
then
echo $MESSAGE1
echo $MESSAGE2
exit 1
else
mt -t "$DEVICE" rew
fi
if [ $? -ne 0 ]
then
echo "There is no tape"
else
echo " Tape is loaded."
fi
and replace it with this:
##############################
# Checking if device is given
if [ -z "$DEVICE" ]
then
echo $MESSAGE1
echo $MESSAGE2
exit 1
fi
mt -t "$DEVICE" rew
TAPEISLOADED=$?
while [ "$TAPEISLOADED" != "0" ]
do
echo "There is no tape"
# send an email here to notify someone
sleep 60
mt -t "$DEVICE" rew
TAPEISLOADED=$?
done
echo " Tape is loaded."
##############################
live free or die
harry
Live Free or Die
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2002 12:39 PM
04-30-2002 12:39 PM
Re: guru help needed for script
Hi Anthony. Maybe this will work. As you check to see wether or not each required element is present or not run each required element through a loop check. I will try to give an example:
# Checking to see if device is given
if [ -z "$DEVICE" ]
then
echo "Please enter valid device name."
echo "Press Enter when done."
read answer1
else
mt -t "$DEVICE" rew
fi
Something like this, if the parameter is not entered, prompt the user and the script will wait for their reply before continuing.
# Checking to see if device is given
if [ -z "$DEVICE" ]
then
echo "Please enter valid device name."
echo "Press Enter when done."
read answer1
else
mt -t "$DEVICE" rew
fi
Something like this, if the parameter is not entered, prompt the user and the script will wait for their reply before continuing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2002 02:50 AM
05-01-2002 02:50 AM
Re: guru help needed for script
hi try this,
if [ -z "$DEVICE" ]
then
echo "Check Device name/insert the tape and press any key when ready"
read accept
else
mt -t "$DEVICE" rew
fi
regds
ravi
if [ -z "$DEVICE" ]
then
echo "Check Device name/insert the tape and press any key when ready"
read accept
else
mt -t "$DEVICE" rew
fi
regds
ravi
Never Say No
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP