<?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: using tar and grep together in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281172#M882104</link>
    <description>Curt,&lt;BR /&gt; &lt;BR /&gt;"tar" doesn't read the list of files to backup from stdin, I think you are thinking of "cpio".&lt;BR /&gt; &lt;BR /&gt;John,&lt;BR /&gt; &lt;BR /&gt;Unfortunatelly if their are a lot of directories the xargs command could run the tar command multiple times. Thus the file mytar.tar will have whatever the last tar command that was executed.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
    <pubDate>Wed, 19 May 2004 14:17:09 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2004-05-19T14:17:09Z</dc:date>
    <item>
      <title>using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281167#M882099</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I have a directory structure with 50000 sub-directories, totalling 30 gbytes.&lt;BR /&gt;&lt;BR /&gt;i would like to tar it up, however, what i would lik eto do is grep out sub-directories with certain specific names in them.&lt;BR /&gt;&lt;BR /&gt;e.g. grep -v sun and a grep -v irix or even a grep -v French&lt;BR /&gt;&lt;BR /&gt;is there a way I can do all this on one command line?</description>
      <pubDate>Wed, 19 May 2004 11:52:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281167#M882099</guid>
      <dc:creator>Naeem Ali_2</dc:creator>
      <dc:date>2004-05-19T11:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281168#M882100</link>
      <description>Yes, get GNU's TAR from &lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25/&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;and you can do slick things like:&lt;BR /&gt; &lt;BR /&gt;cd YOURbigDIRECTORY&lt;BR /&gt;/opt/tar/bin/tar --create --verbose --file=/var/appl/crazy.tar --exclude="*\/DNS&lt;BR /&gt;CACHE_INSTALLDIRhp11.11\/*" --exclude "*\/OraInstall200[2-4]-[0-9][0-9]-[0-9][0-&lt;BR /&gt;9]_[0-9][0-9]-[0-9][0-9]-[0-9][0-9]PM\/*" --exclude "*\/PHTXT\/*" --gzip ./*&lt;BR /&gt; &lt;BR /&gt;The exclude will still create the upper directory entry, but it will NOT archive any files under it!&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;If you use gzip or compress on your archive, then you have to tell the --list option how the archive was compressed (--gzip in this case):&lt;BR /&gt;/opt/tar/bin/tar --list --file=/var/appl/crazy.tar --gzip|more&lt;BR /&gt; &lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 19 May 2004 12:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281168#M882100</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2004-05-19T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281169#M882101</link>
      <description>You could also use "pax" that is now standard with hpux11.&lt;BR /&gt; &lt;BR /&gt;find /mydir -type d -print| grep -v irix | pax -wd -x utar &amp;gt;mysave.tar&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 19 May 2004 13:49:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281169#M882101</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-05-19T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281170#M882102</link>
      <description>you can always use find with the prune options&lt;BR /&gt;&lt;BR /&gt;find ./ -prune ... | tar ...&lt;BR /&gt;&lt;BR /&gt;an example using prune&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1084992752438+28353475&amp;amp;threadId=245727" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1084992752438+28353475&amp;amp;threadId=245727&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;find ./  | grep -vE "sun|irix|French" | tar&lt;BR /&gt;&lt;BR /&gt;but you might exclude more then you think that way</description>
      <pubDate>Wed, 19 May 2004 13:55:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281170#M882102</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-05-19T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281171#M882103</link>
      <description>Hi,&lt;BR /&gt;you could try and bend the find command a litte and use the not operator for excluding filenames, e.g.:&lt;BR /&gt;# find . -type f ! -name "*sun*" ! -name "*French*"|xargs tar cvf - &amp;gt;mytar.tar&lt;BR /&gt; &lt;BR /&gt;mytar.tar should be located out of reach of the find command.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 May 2004 13:56:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281171#M882103</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-05-19T13:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: using tar and grep together</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281172#M882104</link>
      <description>Curt,&lt;BR /&gt; &lt;BR /&gt;"tar" doesn't read the list of files to backup from stdin, I think you are thinking of "cpio".&lt;BR /&gt; &lt;BR /&gt;John,&lt;BR /&gt; &lt;BR /&gt;Unfortunatelly if their are a lot of directories the xargs command could run the tar command multiple times. Thus the file mytar.tar will have whatever the last tar command that was executed.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 19 May 2004 14:17:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-tar-and-grep-together/m-p/3281172#M882104</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-05-19T14:17:09Z</dc:date>
    </item>
  </channel>
</rss>

