<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bourne Shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426364#M728873</link>
    <description>try this script;&lt;BR /&gt;&lt;BR /&gt;mt -t /dev/rmt/0m rew &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo " There is no tape in the tape drive, you cannot continue"&lt;BR /&gt;echo " Backup aborted"&lt;BR /&gt;else&lt;BR /&gt;echo "Backup Starting"&lt;BR /&gt;fbackup -0vi/ -f /dev/rmt/0m -I /tmp/fbackup_index&lt;BR /&gt;fi    &lt;BR /&gt;&lt;BR /&gt;Regards..&lt;BR /&gt;Michelle</description>
    <pubDate>Thu, 06 Jul 2000 03:48:47 GMT</pubDate>
    <dc:creator>Andrew Brain or Yong Ji</dc:creator>
    <dc:date>2000-07-06T03:48:47Z</dc:date>
    <item>
      <title>Bourne Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426361#M728870</link>
      <description>Hello all,&lt;BR /&gt;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: &lt;BR /&gt;if  "tape is not into drive"&lt;BR /&gt;then&lt;BR /&gt;     echo " Tape is not into drive. Do you want to continue ? Y/N"&lt;BR /&gt;     if answer = "Y" &lt;BR /&gt;          echo " Backup aborted"&lt;BR /&gt;          exit&lt;BR /&gt;     fi&lt;BR /&gt;else &lt;BR /&gt;fbackup -0vi/ -f /dev/rmt/0m -I /tmp/fbackup_index&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jun 2000 09:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426361#M728870</guid>
      <dc:creator>TRUONG</dc:creator>
      <dc:date>2000-06-15T09:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bourne Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426362#M728871</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;dd if=/dev/rmt/0m of=/dev/null bs=5k count=1 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;  echo "No Tape in Drive or Drive not ready"&lt;BR /&gt;else&lt;BR /&gt;  fbackup ....&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Greetings&lt;BR /&gt;&lt;BR /&gt;Andrew</description>
      <pubDate>Thu, 15 Jun 2000 09:06:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426362#M728871</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-06-15T09:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bourne Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426363#M728872</link>
      <description>You might also want to try the mt command with $TAPE set to the required tape device file e.g.&lt;BR /&gt;&lt;BR /&gt;TAPE=/dev/rmt/1mn          # bourne shell&lt;BR /&gt;export TAPE                # bourne shell&lt;BR /&gt;or simply&lt;BR /&gt;export TAPE=/dev/rmt/1mn   # ksh or posix&lt;BR /&gt;&lt;BR /&gt;if    mt rew 2&amp;gt;/dev/null   # rewinds the tape&lt;BR /&gt;then  fbackup ...&lt;BR /&gt;else  echo "tape not loaded..."&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jun 2000 20:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426363#M728872</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-06-15T20:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Bourne Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426364#M728873</link>
      <description>try this script;&lt;BR /&gt;&lt;BR /&gt;mt -t /dev/rmt/0m rew &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo " There is no tape in the tape drive, you cannot continue"&lt;BR /&gt;echo " Backup aborted"&lt;BR /&gt;else&lt;BR /&gt;echo "Backup Starting"&lt;BR /&gt;fbackup -0vi/ -f /dev/rmt/0m -I /tmp/fbackup_index&lt;BR /&gt;fi    &lt;BR /&gt;&lt;BR /&gt;Regards..&lt;BR /&gt;Michelle</description>
      <pubDate>Thu, 06 Jul 2000 03:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426364#M728873</guid>
      <dc:creator>Andrew Brain or Yong Ji</dc:creator>
      <dc:date>2000-07-06T03:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bourne Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426365#M728874</link>
      <description>If you use cpio in the previous scenario it will even tell you if write protect is on.&lt;BR /&gt;ls /etc/copyright|cpio -omB &amp;gt; /dev/Tapedrive&lt;BR /&gt;(you will get any cpio messages here "&lt;BR /&gt;if [[ $? != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;    echo "Tape device not ready"&lt;BR /&gt;fi&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Fri, 07 Jul 2000 14:31:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bourne-shell-script/m-p/2426365#M728874</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2000-07-07T14:31:58Z</dc:date>
    </item>
  </channel>
</rss>

