<?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 find files and tar them in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477545#M362136</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do i use find and tar command together ?&lt;BR /&gt;I just want to find some files and tar the output in a tar file.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
    <pubDate>Tue, 11 Aug 2009 21:19:39 GMT</pubDate>
    <dc:creator>Shivkumar</dc:creator>
    <dc:date>2009-08-11T21:19:39Z</dc:date>
    <item>
      <title>find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477545#M362136</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do i use find and tar command together ?&lt;BR /&gt;I just want to find some files and tar the output in a tar file.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Tue, 11 Aug 2009 21:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477545#M362136</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2009-08-11T21:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477546#M362137</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;If we assume HP-UX (since it is in that community that you ask), then I'd do something like this:&lt;BR /&gt;&lt;BR /&gt;# FILES=$(find /path -xdev -type f -mtime +7)&lt;BR /&gt;# tar -cvf /tmp/myarchive ${FILES}&lt;BR /&gt;&lt;BR /&gt;...or whatever your specification is for collecting the files ...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Aug 2009 21:29:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477546#M362137</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-11T21:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477547#M362138</link>
      <description>&lt;!--!*#--&gt;&amp;gt; # FILES=$(find /path -xdev -type f -mtime +7)&lt;BR /&gt;&amp;gt; # tar -cvf /tmp/myarchive ${FILES}&lt;BR /&gt;&lt;BR /&gt;And what is the command-line length limit&lt;BR /&gt;these days?&lt;BR /&gt;&lt;BR /&gt;And then there are the potential problems in&lt;BR /&gt;the funny-file-name class:&lt;BR /&gt;&lt;BR /&gt;dyi # ls -l gtt&lt;BR /&gt;total 0&lt;BR /&gt;-rw-r--r--   1 root       sys              0 Aug 11 12:59 a a&lt;BR /&gt;&lt;BR /&gt;dyi # FILES=$( find gtt -type f )&lt;BR /&gt;&lt;BR /&gt;dyi # echo ${FILES}&lt;BR /&gt;gtt/a a&lt;BR /&gt;&lt;BR /&gt;dyi # tar cvf gtt.tar ${FILES}&lt;BR /&gt;tar: cannot stat gtt/a.  Not dumped.&lt;BR /&gt;tar: cannot stat a.  Not dumped.&lt;BR /&gt;&lt;BR /&gt;GNU "tar" has a "--files-from=file-name"&lt;BR /&gt;("-T file-name") option which can be helpful&lt;BR /&gt;in cases where "${FILES}" would cause&lt;BR /&gt;problems.  "--files-from=-" or "-T -" works&lt;BR /&gt;to get the file names from stdin, so a "find"&lt;BR /&gt;pipeline can feed in the file names.  For&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;dyi # find gtt -type f | gtar cfv gtt.tar -T -&lt;BR /&gt;gtt/a a&lt;BR /&gt;&lt;BR /&gt;dyi # tar tfv gtt.tar&lt;BR /&gt;rw-r--r--   0/3      0 Aug 11 12:59 2009 gtt/a a&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dyi # uname -a&lt;BR /&gt;HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;dyi # gtar --version&lt;BR /&gt;tar (GNU tar) 1.18&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;For a variety of reasons, it's often a bad&lt;BR /&gt;idea to use file-name wild cards (like "*"),&lt;BR /&gt;or equivalent constructs, in a command line.&lt;BR /&gt;One of the best reasons to use "find" is to&lt;BR /&gt;avoid problems like this, but sloppy use of&lt;BR /&gt;"find" can effectively demolish many of its&lt;BR /&gt;advantages.</description>
      <pubDate>Wed, 12 Aug 2009 03:26:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477547#M362138</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-08-12T03:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477548#M362139</link>
      <description>You can try -exec option of find command also.&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;find ./ -name "..." -exec tar cvf {} \;</description>
      <pubDate>Wed, 12 Aug 2009 04:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477548#M362139</guid>
      <dc:creator>Andrey Chipalyuk</dc:creator>
      <dc:date>2009-08-12T04:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477549#M362140</link>
      <description>&amp;gt;How do I use find and tar command together?&lt;BR /&gt;&lt;BR /&gt;If you have a trivial number of files, you can  use JRF's example.  Or you use Steven's gtar example.&lt;BR /&gt;&lt;BR /&gt;Otherwise you don't use tar.  Instead you use pax(1):&lt;BR /&gt;find /path -xdev -type f -mtime +7 | pax -v -w -f /tmp/myarchive&lt;BR /&gt;&lt;BR /&gt;You can use pax or tar to restore.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Andrey: You can try -exec option of find command also.&lt;BR /&gt;&lt;BR /&gt;There are lots of reasons this won't work, don't even try.</description>
      <pubDate>Wed, 12 Aug 2009 09:53:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477549#M362140</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-08-12T09:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477550#M362141</link>
      <description>&lt;!--!*#--&gt;&amp;gt; There are lots of reasons this won't work,&lt;BR /&gt;&amp;gt; don't even try.&lt;BR /&gt;&lt;BR /&gt;Or, if you're the fellow who made the&lt;BR /&gt;suggestion, then try it _before_ posting it.</description>
      <pubDate>Wed, 12 Aug 2009 10:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477550#M362141</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-08-12T10:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: find files and tar them</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477551#M362142</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Steven: And what is the command-line length limit these days?&lt;BR /&gt;&lt;BR /&gt;Far larger than the days of HP-UX 10.20 and prior:&lt;BR /&gt;&lt;BR /&gt;# getconf ARG_MAX&lt;BR /&gt;2048000&lt;BR /&gt;&lt;BR /&gt;That said, on an "un-enhanced" HP-UX system (i.e. without some of the really nice GNU tools), I agree with Dennis --- 'pax' is probably the better choice.  Oh, and your point about nasty files with embedded spaces is well taken, of course.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Aug 2009 10:59:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-files-and-tar-them/m-p/4477551#M362142</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-12T10:59:24Z</dc:date>
    </item>
  </channel>
</rss>

