<?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: Exclude tar a directory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647289#M240010</link>
    <description>You could use pax to create the archive. you should be able to read/extract it using tar. pax will allow you to pipe the file list into it. &lt;BR /&gt;&lt;BR /&gt;find ...  | pax -wf archive_file&lt;BR /&gt;&lt;BR /&gt;You can customize the find/pattern command to only list the files you want?</description>
    <pubDate>Wed, 12 Oct 2005 05:00:52 GMT</pubDate>
    <dc:creator>Stephen Keane</dc:creator>
    <dc:date>2005-10-12T05:00:52Z</dc:date>
    <item>
      <title>Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647284#M240005</link>
      <description>If use tar file from a directory , how to exclude a sub-directory in this directory ?&lt;BR /&gt;&lt;BR /&gt;ll&lt;BR /&gt;drw-r--r--    1 root       root              4096 Oct 12 11:58 b&lt;BR /&gt;drw-r--r--    1 root       root              4096 Oct 12 10:54 c&lt;BR /&gt;drwxr-xr-x    2 root       root              4096 Oct 12 11:57 d&lt;BR /&gt;drw-r--r--    1 root       root              4096 Oct 12 10:54 d&lt;BR /&gt;eg . I want to tar all files under the above directory but exclude the sub-directory "c" ( not exclude file ) , could advise how to do it ? thx</description>
      <pubDate>Tue, 11 Oct 2005 23:10:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647284#M240005</guid>
      <dc:creator>addendum</dc:creator>
      <dc:date>2005-10-11T23:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647285#M240006</link>
      <description>hello&lt;BR /&gt;&lt;BR /&gt;u can use the -x option copy file or all files from a directory&lt;BR /&gt;&lt;BR /&gt;regrads gga</description>
      <pubDate>Wed, 12 Oct 2005 01:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647285#M240006</guid>
      <dc:creator>GGA</dc:creator>
      <dc:date>2005-10-12T01:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647286#M240007</link>
      <description>`-S'&lt;BR /&gt;`--separate-dirs'&lt;BR /&gt;     Report the size of each directory separately, not including the&lt;BR /&gt;     sizes of subdirectories.&lt;BR /&gt;&lt;BR /&gt;`-x'&lt;BR /&gt;`--one-file-system'&lt;BR /&gt;     Skip directories that are on different filesystems from the one&lt;BR /&gt;     that the argument being processed is on.&lt;BR /&gt;&lt;BR /&gt;`--exclude=PAT'&lt;BR /&gt;     When recursing, skip subdirectories or files matching PAT.  For&lt;BR /&gt;     example, `du --exclude='*.o'' excludes files whose names end in&lt;BR /&gt;     `.o'.&lt;BR /&gt;&lt;BR /&gt;`-X FILE'&lt;BR /&gt;`--exclude-from=FILE'&lt;BR /&gt;     Like `--exclude', except take the patterns to exclude from FILE,&lt;BR /&gt;     one per line.  If FILE is `-', take the patterns from standard&lt;BR /&gt;     input.&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Oct 2005 01:35:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647286#M240007</guid>
      <dc:creator>Mugilvannan</dc:creator>
      <dc:date>2005-10-12T01:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647287#M240008</link>
      <description>thx all replies,&lt;BR /&gt;&lt;BR /&gt;from your suggestions , it seems no parameter can exclude the directory to tar , isn't it ? thx</description>
      <pubDate>Wed, 12 Oct 2005 02:25:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647287#M240008</guid>
      <dc:creator>addendum</dc:creator>
      <dc:date>2005-10-12T02:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647288#M240009</link>
      <description>You can supply the directories to be tar'red up using command substitution. Assuming your curent directory is the one that contains the above sub-directories then:&lt;BR /&gt;&lt;BR /&gt;# tar cvf /tmp/tarfile $(ll -tr | awk '$1~/^d/ &amp;amp;&amp;amp; $NF!="c" {print $NF}')</description>
      <pubDate>Wed, 12 Oct 2005 04:56:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647288#M240009</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-10-12T04:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647289#M240010</link>
      <description>You could use pax to create the archive. you should be able to read/extract it using tar. pax will allow you to pipe the file list into it. &lt;BR /&gt;&lt;BR /&gt;find ...  | pax -wf archive_file&lt;BR /&gt;&lt;BR /&gt;You can customize the find/pattern command to only list the files you want?</description>
      <pubDate>Wed, 12 Oct 2005 05:00:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647289#M240010</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-10-12T05:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647290#M240011</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can use KSH filename generation to let the shell do this for you - just have no HPUX at hand to check, whether the posix shell has this capability as well:&lt;BR /&gt;(in ksh)&lt;BR /&gt;!(name) will match anything but 'name',&lt;BR /&gt;so&lt;BR /&gt;tar cf xxx.tar !(c)&lt;BR /&gt;will not archive 'c'.&lt;BR /&gt;&lt;BR /&gt;mfG nik&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2005 08:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647290#M240011</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2005-10-13T08:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647291#M240012</link>
      <description>Put the directory names into a file called useme.&lt;BR /&gt;&lt;BR /&gt;Let's assume that you're dir name that you're excluding isn't "c" , but "mydir":&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print $NF}' | grep -v mydir &amp;gt; useme&lt;BR /&gt;&lt;BR /&gt;verify the list of directories and files:&lt;BR /&gt;&lt;BR /&gt;cat useme&lt;BR /&gt;&lt;BR /&gt;create tarball with just those files:&lt;BR /&gt;&lt;BR /&gt;tar -cvf my.tar `cat useme`&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2005 09:34:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647291#M240012</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-10-13T09:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647292#M240013</link>
      <description>Hi Kent,&lt;BR /&gt;&lt;BR /&gt;remember, that a inverse-match (via grep -v mydir) has the bad effect of eliminating entries like&lt;BR /&gt;savemydir&lt;BR /&gt;as well.&lt;BR /&gt;More, the filename generation pattern can easily extended to more than one exception entry like&lt;BR /&gt;!(c|d)&lt;BR /&gt;which leads to multiple&lt;BR /&gt;grep -v one | grep -v other ..&lt;BR /&gt;in your solution.&lt;BR /&gt;Possible would be&lt;BR /&gt;ls | awk '{$1 ~ "mydir";next};{print}' to get the list.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 13 Oct 2005 10:06:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647292#M240013</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2005-10-13T10:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647293#M240014</link>
      <description>Sorry,&lt;BR /&gt;I wanted to state&lt;BR /&gt;&lt;BR /&gt;ls | awk '{$1 == "mydir";next};{print}' to get the list.</description>
      <pubDate>Thu, 13 Oct 2005 10:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647293#M240014</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2005-10-13T10:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude tar a directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647294#M240015</link>
      <description>Peter -- you're correct ... it's a point I made somewhere else ...&lt;BR /&gt;&lt;BR /&gt;Taking your comments along with what I wrote earlier:&lt;BR /&gt;&lt;BR /&gt;Put the directory names into a file called useme.&lt;BR /&gt;&lt;BR /&gt;Let's assume that you're dir name that you're excluding isn't "c" , but "mydir":&lt;BR /&gt;&lt;BR /&gt;ls | awk '{$1 == "mydir";next};{print}' &amp;gt; useme&lt;BR /&gt;&lt;BR /&gt;verify the list of directories and files:&lt;BR /&gt;&lt;BR /&gt;cat useme&lt;BR /&gt;&lt;BR /&gt;create tarball with just those files:&lt;BR /&gt;&lt;BR /&gt;tar -cvf my.tar `cat useme`</description>
      <pubDate>Thu, 13 Oct 2005 10:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exclude-tar-a-directory/m-p/3647294#M240015</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-10-13T10:16:58Z</dc:date>
    </item>
  </channel>
</rss>

