login
Header Space

 
 

how can I "find xyz | xargs tar" ... like gtar

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <misc@...>
Date: Sunday, September 23, 2007 - 2:53 pm

Hello,
I would like to tar and compress my ports dir without the following 2 directories:
a) distfiles
b) packages

Here is a gtar command I used that works well:
cd /usr && gtar -czpf ~/test.tar.gz --exclude=packages --exclude=distfiles ports

Actually I would like to do the same with the default openbsd tools ... but I can't :-((

I tried different commands ... but without success .... it does not work.
Using "find ... | xargs tar ..." does not work as expected, as it looks like xargs invokes the tar command multiple times. 
As a result, the ports.tar.gz file is overwritten and incomplete.

I tried a lot of combinations like:
cd /usr
find ports/ ! \( -type d -name packages -maxdepth 1 \) -and !  \( -type d -name distfiles -maxdepth 1 \) -print \
| xargs tar -czpf ~/ports.tar.gz;
This does not work .... the ports.tar.gz file is overwritten multiple times and at the end it is incomplete.
I also tried pax or tried to redirect the find command in a file ( find .. > files.txt), and use "cat files | xargs tar ..." same result :-(

How can achive my goal with the standard openbsd files (without installing gtar!)?

Thank you very much
didier
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
how can I "find xyz | xargs tar" ... like gtar, Didier Wiroth, (Sun Sep 23, 2:53 pm)
Re: how can I "find xyz | xargs tar" ... like gtar, Marc Espie, (Sun Sep 23, 6:23 pm)
Re: how can I "find xyz | xargs tar" ... like gtar, Han Boetes, (Sun Sep 23, 3:23 pm)
Re: how can I "find xyz | xargs tar" ... like gtar, Mats O Jansson, (Sun Sep 23, 3:41 pm)
Re: how can I "find xyz | xargs tar" ... like gtar, Antoine Jacoutot, (Sun Sep 23, 2:59 pm)
speck-geostationary