<?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 and find command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377925#M348161</link>
    <description>Thanks James. My only problem is that I then want to untar on hpserv02 and using the /net/hpserv01/LTX/hp_testdev_duts/ -mtime +100 will put it back where it came from when I untar.  I eventually want to erase those files from hpserv01 when I have the data sucessfully untarred on hpserv02.&lt;BR /&gt;&lt;BR /&gt;I would do a mv command but afraid I will loose my data and screw things up.&lt;BR /&gt;&lt;BR /&gt;Any ideas ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;phil&lt;BR /&gt;</description>
    <pubDate>Thu, 12 Mar 2009 16:26:16 GMT</pubDate>
    <dc:creator>Phillip Popp</dc:creator>
    <dc:date>2009-03-12T16:26:16Z</dc:date>
    <item>
      <title>Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377923#M348159</link>
      <description>Hi Running 10.2.  I have two machines.  I want to tar up files in a rather large directory older then say 3 years.  I am combining the tar command and find command as follows.  I can not tar the file to machine called hpserv01 as there is not enough space left on the hard drive, so I must build the tar file to the machine called hpserv02.  When I try this command from hpserv01 it give me a return message of arg list too long. If I put in more then 1000 to reduce the size of the arguments it tells me o file, no data.  Can some one give me some guidence on how to get past the list too long issue.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;command from hpserv01: tar -cvf ./testdev_duts.tar `find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000`&lt;BR /&gt;&lt;BR /&gt;any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 15:50:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377923#M348159</guid>
      <dc:creator>Phillip Popp</dc:creator>
      <dc:date>2009-03-12T15:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377924#M348160</link>
      <description>Hi Phil:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000 | xargs tar -cvf ./testdev_duts.tar &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 16:10:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377924#M348160</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T16:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377925#M348161</link>
      <description>Thanks James. My only problem is that I then want to untar on hpserv02 and using the /net/hpserv01/LTX/hp_testdev_duts/ -mtime +100 will put it back where it came from when I untar.  I eventually want to erase those files from hpserv01 when I have the data sucessfully untarred on hpserv02.&lt;BR /&gt;&lt;BR /&gt;I would do a mv command but afraid I will loose my data and screw things up.&lt;BR /&gt;&lt;BR /&gt;Any ideas ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;phil&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 16:26:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377925#M348161</guid>
      <dc:creator>Phillip Popp</dc:creator>
      <dc:date>2009-03-12T16:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377926#M348162</link>
      <description>Hi (again) Phil:&lt;BR /&gt;&lt;BR /&gt;With 'tar' you should create archives with _relative_ paths instead of absolute ones unless (1) you want to "go nuts"; or (2) use 'pax' to strip the leading '/' to make a relative path.&lt;BR /&gt;&lt;BR /&gt;That said, change you find to output relative paths:&lt;BR /&gt;&lt;BR /&gt;# cd /path&lt;BR /&gt;# find . -mtime +1000&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Mar 2009 16:35:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377926#M348162</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T16:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377927#M348163</link>
      <description>Sweet!! that did the trick.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 16:50:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377927#M348163</guid>
      <dc:creator>Phillip Popp</dc:creator>
      <dc:date>2009-03-12T16:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377928#M348164</link>
      <description>You could have just:&lt;BR /&gt;&lt;BR /&gt;find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000 | tar -cvf - | ssh hpserv02 "(cd /some/dir; tar xf -)'</description>
      <pubDate>Thu, 12 Mar 2009 17:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377928#M348164</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2009-03-12T17:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377929#M348165</link>
      <description>You could have just:&lt;BR /&gt;&lt;BR /&gt;find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000 | tar -cvf - | ssh hpserv02 "(cd /some/dir; tar xf -)"</description>
      <pubDate>Thu, 12 Mar 2009 17:43:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377929#M348165</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2009-03-12T17:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377930#M348166</link>
      <description>&amp;gt;I am combining the tar command and find command as follows. ... arg list too long&lt;BR /&gt;&lt;BR /&gt;You can't really use find and tar for large amounts of files, don't even try.  Instead use cpio or pax(1).  Both of these take their files from stdin:&lt;BR /&gt;find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000 | \&lt;BR /&gt;pax -w -f ./testdev_duts.tar&lt;BR /&gt;&lt;BR /&gt;pax also allows you to to rename the files when you extract so you don't have to cd into the directory root, as JRF suggested.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: find ... | xargs tar -cvf ./testdev_duts.tar&lt;BR /&gt;&lt;BR /&gt;This will fail since it will overwrite the tarfile over and over.</description>
      <pubDate>Thu, 12 Mar 2009 17:48:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377930#M348166</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-12T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377931#M348167</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Ah, oops.  Good catch, Dennis.  You are correct, the 'find ... | xargs ...' will indeed _overwrite_.&lt;BR /&gt;&lt;BR /&gt;Phil, compare a test case like this where there are a relatively few files:&lt;BR /&gt;&lt;BR /&gt;# find /tmp -type f -mtime -7|xargs tar -cvf /var/tmp/MYTHING&lt;BR /&gt;&lt;BR /&gt;# tar -tvf /tmp/MYTHING&lt;BR /&gt;&lt;BR /&gt;...versus:&lt;BR /&gt;&lt;BR /&gt;# find /tmp -type f -mtime -7|xargs -l2 tar -cvf /var/tmp/MYTHING&lt;BR /&gt;&lt;BR /&gt;# # tar -tvf /tmp/MYTHING&lt;BR /&gt;&lt;BR /&gt;...which takes two (2) arguments at a time.  This demonstates the problem Dennis cited.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Mar 2009 17:56:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377931#M348167</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T17:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377932#M348168</link>
      <description>Your right.  It looked like it was tarring it al up, then after it finished it only had the last directory in it.  Close but not quite.  I have never used the pax command.  Is that standard on all hp10.2.  also, that command will not put the file to the wrong box, as I have only limited amount of space on it.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;phil&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 17:56:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377932#M348168</guid>
      <dc:creator>Phillip Popp</dc:creator>
      <dc:date>2009-03-12T17:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377933#M348169</link>
      <description>&amp;gt;Is that standard on all 10.20?&lt;BR /&gt;&lt;BR /&gt;If the command is there on one, it should be on all.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;it finished it only had the last directory in it.&lt;BR /&gt;&lt;BR /&gt;I assumed you were happy because JRF's cd approach would reduce the length of the command line.</description>
      <pubDate>Thu, 12 Mar 2009 18:05:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377933#M348169</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-12T18:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377934#M348170</link>
      <description>Hi Phil:&lt;BR /&gt;&lt;BR /&gt;Yes, 'pax' exists on 10.20 :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-90128/pax.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-90128/pax.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Another alternative is to install the GNU tar which allows 'â  --files-from=file-nameâ   which is designed to read a list of filenames contained in a file as you would generate from a 'find' command.&lt;BR /&gt;&lt;BR /&gt;You can fetch GNU tar from here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.20/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.20/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...though for 10.20, you will have to compile it yourself&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Mar 2009 18:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377934#M348170</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T18:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377935#M348171</link>
      <description>I use like:&lt;BR /&gt;&lt;BR /&gt;tar zcvf test.tar $(find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000)</description>
      <pubDate>Fri, 13 Mar 2009 11:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377935#M348171</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-03-13T11:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377936#M348172</link>
      <description>Thanks,&lt;BR /&gt;The pax command did the trick.  did not even know about that command.&lt;BR /&gt;&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 11:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377936#M348172</guid>
      <dc:creator>Phillip Popp</dc:creator>
      <dc:date>2009-03-13T11:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377937#M348173</link>
      <description>&lt;!--!*#--&gt;&amp;gt;  I use like:&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;Or, if you'd like a method which _won't_&lt;BR /&gt;produce a too-long command line, GNU "tar"&lt;BR /&gt;has a "--files-from=file-name"&lt;BR /&gt;("-T=file-name") option, and "file-name" can&lt;BR /&gt;be "-" (stdin), so you could pipe the "find"&lt;BR /&gt;output into it.</description>
      <pubDate>Fri, 13 Mar 2009 14:57:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377937#M348173</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-03-13T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377938#M348174</link>
      <description>&amp;gt;&amp;gt;I use like:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;tar zcvf test.tar $(find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000)&lt;BR /&gt;&lt;BR /&gt;This may be fine on Linux, or with GNU tar, but with the HP-UX native tar the '-z' option  (to create a gzip'ed tar file) is not valid.&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 15:10:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377938#M348174</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2009-03-13T15:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377939#M348175</link>
      <description>Patrick, &lt;BR /&gt;&lt;BR /&gt;Yeah we could do:&lt;BR /&gt;&lt;BR /&gt;tar cvf test.tar $(find /net/hpserv02/LTX/hp_testdev_duts/ -mtime +1000) &amp;amp;&amp;amp; gzip test.tar&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 15:46:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377939#M348175</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-03-13T15:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tar and find command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377940#M348176</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Yeah we could do:&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;Or, we could learn something, and avoid the&lt;BR /&gt;problem of the too-long command line, and&lt;BR /&gt;also avoid the temporary file.  (HP-UX shells&lt;BR /&gt;_do_ know how to deal with pipelines.)</description>
      <pubDate>Fri, 13 Mar 2009 17:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-and-find-command/m-p/4377940#M348176</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-03-13T17:23:47Z</dc:date>
    </item>
  </channel>
</rss>

