<?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: gtar &amp;amp; pattern matching script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795469#M80831</link>
    <description>Kapil,&lt;BR /&gt;&lt;BR /&gt;Unfortunately I can't change the way it has been archived into the tapes. This is because these tapes were shipped from overseas.&lt;BR /&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Wed, 28 Aug 2002 01:44:06 GMT</pubDate>
    <dc:creator>Chern Jian Leaw</dc:creator>
    <dc:date>2002-08-28T01:44:06Z</dc:date>
    <item>
      <title>gtar &amp; pattern matching script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795467#M80829</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;I know that this problem is very similar in nature to the thread on "gtar-extracting tape contents." But I'd like some help with some scripts provided this thread.&lt;BR /&gt;&lt;BR /&gt;I have 7 tapes contains archived filesystems of the form:&lt;BR /&gt;/bak/fs37/opt_regression &lt;BR /&gt;/bak/fs37/fourier_calc &lt;BR /&gt;/bak/fs20/run_script &lt;BR /&gt;(list continues ...)&lt;BR /&gt;&lt;BR /&gt;Every archived filesystems have the /bak as the prefix in the filesystem name.&lt;BR /&gt;&lt;BR /&gt;I would like to have these filesystems extracted from the tape and restored as:&lt;BR /&gt;/fs37/opt_regression &lt;BR /&gt;/fs37/fourier_calc &lt;BR /&gt;/fs20/run_script &lt;BR /&gt;&lt;BR /&gt;NOT as&lt;BR /&gt;/bak/fs37/opt_regression &lt;BR /&gt;/bak/fs37/fourier_calc &lt;BR /&gt;/bak/fs20/run_script &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a script written by Ceesjan Van Hatum which should ignore the /bak prefix during restore, but somehow it DID NOT:&lt;BR /&gt;&lt;BR /&gt;#cat ceesjan.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for i in `gtar -tvf /dev/rmt1`&lt;BR /&gt;do &lt;BR /&gt;   echo "Retrieving $i"&lt;BR /&gt;   gtar -xvf /dev/rmt $i&lt;BR /&gt;   mv /bak/$i /$i&lt;BR /&gt;done   &lt;BR /&gt;&lt;BR /&gt;Could someone please show me how I should do a pattern match to extract only the of suffixes /bak from the tapes? &lt;BR /&gt;e.g:&lt;BR /&gt;/bak/fs37/opt_regression to be extracted and restored as /fs37/opt_regression&lt;BR /&gt;&lt;BR /&gt;Or are there any other alternatives to this problem? &lt;BR /&gt;&lt;BR /&gt;Could someone please help?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Wed, 28 Aug 2002 00:59:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795467#M80829</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-28T00:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: gtar &amp; pattern matching script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795468#M80830</link>
      <description>does it give an error message ?. does "/fs37/opt_regression" already exist in the box ?. If yes move it to another name. then run the same script. that should work .&lt;BR /&gt;&lt;BR /&gt;A best solution to the problem is, to avoid taking backups with absolute path. When you take backup take it with a relative path i mean , if u need to backup /fs37/opt_regression directory take it like "./fs37/opt_regression" so that u can directly restore it any where.&lt;BR /&gt;&lt;BR /&gt;do give a try in the test box. then go to prod. box&lt;BR /&gt;&lt;BR /&gt;kaps &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Aug 2002 01:40:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795468#M80830</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2002-08-28T01:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: gtar &amp; pattern matching script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795469#M80831</link>
      <description>Kapil,&lt;BR /&gt;&lt;BR /&gt;Unfortunately I can't change the way it has been archived into the tapes. This is because these tapes were shipped from overseas.&lt;BR /&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 28 Aug 2002 01:44:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795469#M80831</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-28T01:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: gtar &amp; pattern matching script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795470#M80832</link>
      <description>You can get the suffix of /bak like this:&lt;BR /&gt;cut -d\/ -f3- &lt;BR /&gt;&lt;BR /&gt;for example,&lt;BR /&gt;echo /bak/fs37/fourier_calc  | cut -d\/ -f3- &lt;BR /&gt;will give you &lt;BR /&gt;fs37/fourier_calc  &lt;BR /&gt;&lt;BR /&gt;Assuming you have a valid &amp;amp; usable /bak on your system, the following script should extract one directory at a time into /bak and then move it to $extract_dir. (Not tested, you may have to make some small changes.)&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;extract_dir=&lt;PUT your="" directory="" here=""&gt;&lt;BR /&gt;cd /bak&lt;BR /&gt;for i in `gtar -tvf /dev/rmt1` &lt;BR /&gt;do &lt;BR /&gt;echo "Retrieving $i" &lt;BR /&gt;gtar -xvf /dev/rmt $i &lt;BR /&gt;j=`echo $i | cut -d\/ -f3-` &lt;BR /&gt;mv $j ${extract_dir}/${j} &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;&lt;/PUT&gt;</description>
      <pubDate>Wed, 28 Aug 2002 02:32:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/gtar-amp-pattern-matching-script-problem/m-p/2795470#M80832</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-08-28T02:32:19Z</dc:date>
    </item>
  </channel>
</rss>

