- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Bourne Shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО06-15-2000 02:02 AM
тАО06-15-2000 02:02 AM
Bourne Shell script
Someone can give me a script in HP-UX 10.20 on Bourne Shell to verify the tape exists into drive before making a backup as well as:
if "tape is not into drive"
then
echo " Tape is not into drive. Do you want to continue ? Y/N"
if answer = "Y"
echo " Backup aborted"
exit
fi
else
fbackup -0vi/ -f /dev/rmt/0m -I /tmp/fbackup_index
fi
Thanks a lot
- Tags:
- fbackup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2000 02:06 AM
тАО06-15-2000 02:06 AM
Re: Bourne Shell script
try this:
dd if=/dev/rmt/0m of=/dev/null bs=5k count=1 >/dev/null 2>&1
if [ $? != 0 ]
then
echo "No Tape in Drive or Drive not ready"
else
fbackup ....
fi
Greetings
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2000 01:41 PM
тАО06-15-2000 01:41 PM
Re: Bourne Shell script
TAPE=/dev/rmt/1mn # bourne shell
export TAPE # bourne shell
or simply
export TAPE=/dev/rmt/1mn # ksh or posix
if mt rew 2>/dev/null # rewinds the tape
then fbackup ...
else echo "tape not loaded..."
fi
You could also extend this by using mt eof instead of mt rew (check the man pages for details). This will fail if the tape is actually loaded but is write protected.
- Tags:
- mt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2000 08:48 PM
тАО07-05-2000 08:48 PM
Re: Bourne Shell script
mt -t /dev/rmt/0m rew > /dev/null 2>&1
if [ $? != 0 ]
then
echo " There is no tape in the tape drive, you cannot continue"
echo " Backup aborted"
else
echo "Backup Starting"
fbackup -0vi/ -f /dev/rmt/0m -I /tmp/fbackup_index
fi
Regards..
Michelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2000 07:31 AM
тАО07-07-2000 07:31 AM
Re: Bourne Shell script
ls /etc/copyright|cpio -omB > /dev/Tapedrive
(you will get any cpio messages here "
if [[ $? != 0 ]]
then
echo "Tape device not ready"
fi