<?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: tar: excluding files from an archive in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669023#M50433</link>
    <description>Guys&lt;BR /&gt;&lt;BR /&gt;A big thankyou to all who replied&lt;BR /&gt; - problem now sorted&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Geoff</description>
    <pubDate>Fri, 22 Feb 2002 07:44:47 GMT</pubDate>
    <dc:creator>Geoff Hartnell</dc:creator>
    <dc:date>2002-02-22T07:44:47Z</dc:date>
    <item>
      <title>tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669011#M50421</link>
      <description>On Solaris the tar command has an option (X) to read a file containing a list of files to be excluded from a tar archive.&lt;BR /&gt;&lt;BR /&gt;On the version of HP-UX that I am using  (B.11.00 U 9000/800 ) there is no X option&lt;BR /&gt;&lt;BR /&gt;I need to be able to create different archives from the same root, but to exclude different parts for different builds.&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to do this on HP-UX&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 21 Feb 2002 09:33:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669011#M50421</guid>
      <dc:creator>Geoff Hartnell</dc:creator>
      <dc:date>2002-02-21T09:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669012#M50422</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Unless you install GNU tar, I think you have to workaround this by using a script eg.&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;list=""&lt;BR /&gt;for i in `find $1 -print`&lt;BR /&gt;do&lt;BR /&gt;  if grep "^$i " /etc/tar.exclude &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;  then&lt;BR /&gt;    :&lt;BR /&gt;  else&lt;BR /&gt;    list="$list $i"&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;tar cvf /dev/rmt/0m $list&lt;BR /&gt;#end of script&lt;BR /&gt;&lt;BR /&gt;/etc/tar.exclude includes all the files that are to be excluded.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 21 Feb 2002 09:39:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669012#M50422</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-02-21T09:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669013#M50423</link>
      <description>My advice would be to 'inverse' your tar.exclude file into a tar.include file (which lists the files / directories to be included in the tar).&lt;BR /&gt;A one-time job, and it will make things easier in the long run. Your tar command will simply be:&lt;BR /&gt;tar cvf mytar `cat tar.include`&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Feb 2002 09:58:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669013#M50423</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-02-21T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669014#M50424</link>
      <description>use this:&lt;BR /&gt;&lt;BR /&gt;tar -cvf tarfile `find . -print | egrep -vx 'file1|file2|..|fileX' &lt;BR /&gt;&lt;BR /&gt;or even better the GNU's tar from the site:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.13.25/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.13.25/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Federico&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Feb 2002 10:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669014#M50424</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2002-02-21T10:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669015#M50425</link>
      <description>cpio is a far better way to backup faster more reliable and supports option -f to exclude unwanted files or directories.&lt;BR /&gt;&lt;BR /&gt;try something like this :&lt;BR /&gt;&lt;BR /&gt;find . -depth -print | cpio -oB -f /unwantedfile &amp;gt; /dev/rmt/0m</description>
      <pubDate>Thu, 21 Feb 2002 11:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669015#M50425</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-02-21T11:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669016#M50426</link>
      <description>Guys&lt;BR /&gt;&lt;BR /&gt;Thanks for your help so far, but all of the suggestions fail in one way or another:&lt;BR /&gt;&lt;BR /&gt;a) the 'do' loop fails because while it excludes the dir&lt;BR /&gt;&lt;BR /&gt;/path/to/unwanted_file&lt;BR /&gt;&lt;BR /&gt;it does not exclude&lt;BR /&gt;&lt;BR /&gt;/path/to/unwanted_file/file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;b) use of egrep fails because it excludes names like the unwanted file, so if the dir structure contains&lt;BR /&gt;&lt;BR /&gt;/path/to/unwanted_file/file&lt;BR /&gt;/path/to/unwanted_file_needed/file&lt;BR /&gt;&lt;BR /&gt;then both are are excluded, whereas the second of the above needs to be retained&lt;BR /&gt;&lt;BR /&gt;c) the version of HP-UX that I have does not appear to support cpio -o -f&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any other ideas would be very welcome&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Geoff</description>
      <pubDate>Thu, 21 Feb 2002 15:32:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669016#M50426</guid>
      <dc:creator>Geoff Hartnell</dc:creator>
      <dc:date>2002-02-21T15:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669017#M50427</link>
      <description>Geoff,&lt;BR /&gt;&lt;BR /&gt;As Federico stated (above), gnu's tar, which HP has ported, will do just what you want, plus it handles 2GB+ files, compression, and can do remote tapedrive writing!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 21 Feb 2002 15:35:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669017#M50427</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-02-21T15:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669018#M50428</link>
      <description>Hi Geoff,&lt;BR /&gt;&lt;BR /&gt;The standard tar that comes with hp-ux has no option to exclude files from the archive which extrcting data. I think GNUtar has some support like that.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Feb 2002 15:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669018#M50428</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-02-21T15:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669019#M50429</link>
      <description>Scripting solutions,&lt;BR /&gt;&lt;BR /&gt;change the 'grep "^$i " [file]' to be 'grep "^${i}$" [file] to set grep for complete line, (replace space with $)&lt;BR /&gt;&lt;BR /&gt;then create a second 'if' and 'grep' statement checking 'grep "^$i/" [file] (force subdirectories).&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Thu, 21 Feb 2002 15:39:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669019#M50429</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-02-21T15:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669020#M50430</link>
      <description>Have a look at the pax utility ('man pax' for more info.).  It can write archives in either tar or cpio format and there is a '-c' option which does:&lt;BR /&gt;&lt;BR /&gt;-c - Matches all file or archive members except those specified by the pattern or file arguments.</description>
      <pubDate>Thu, 21 Feb 2002 15:42:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669020#M50430</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-02-21T15:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669021#M50431</link>
      <description>Hi Geoff,&lt;BR /&gt;&lt;BR /&gt;Try this version:&lt;BR /&gt;&lt;BR /&gt;=================================&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;list=""&lt;BR /&gt;for i in `find $1 -type f`&lt;BR /&gt;do&lt;BR /&gt;grep -q "^${i}$" /etc/tar.exclude || list="$list $i"&lt;BR /&gt;done&lt;BR /&gt;echo tar cvf /dev/rmt/0m $list&lt;BR /&gt;=================================&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Thu, 21 Feb 2002 15:43:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669021#M50431</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-02-21T15:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669022#M50432</link>
      <description>Geoff,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;find . -print | grep -v -E -f ./excludelist | grep -v "^\.$"| pax -w &amp;gt; /backuppath&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;pax , by default, writes archives in the ustar extended tar interchange format. (do a man pax)&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 21 Feb 2002 16:18:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669022#M50432</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-02-21T16:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: tar: excluding files from an archive</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669023#M50433</link>
      <description>Guys&lt;BR /&gt;&lt;BR /&gt;A big thankyou to all who replied&lt;BR /&gt; - problem now sorted&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Geoff</description>
      <pubDate>Fri, 22 Feb 2002 07:44:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-excluding-files-from-an-archive/m-p/2669023#M50433</guid>
      <dc:creator>Geoff Hartnell</dc:creator>
      <dc:date>2002-02-22T07:44:47Z</dc:date>
    </item>
  </channel>
</rss>

