Subject: Re: Tar and Find Problem
To: Bruce Anderson <brucea@wavefront.com>
From: Aaron Nelson <nelson@geekhouse.org>
List: netbsd-users
Date: 07/08/1998 14:28:17
> % find /tmp -mtime 1 -type f |tar cvf my.tar -

eek . . . fundamental problem here . . . you are telling tar to create an 
archive called my.tar and store the file "-" into it.

Try it this way:

find /tmp -mtime 1 -type f -print | tar -T - -c -v -f my.tar

According to the man page (if I unstood it correctly), you can't mix
argument styles ( these styles being no dash 'tar cvf', single dash 'tar
-c -v -f', and double dash 'tar --create --verbose --file').

Therefore none of the following will work:  

	tar -T - cvf my.tar
	tar cvf -T - my.tar
	tar cvf my.tar -T -
	tar --from-file - cvf
	etc . . . 

Read the EXAMPLES section of the man page for more details.

Yours,

Aaron Nelson

---------------------------------------------------------
A    A    R    O   N        N    E    L   S    O    N
nelson@null.net

"grep .. grep .. grep" --(Frog with UNIX caught in its throat)

On 8 Jul 1998, Bruce Anderson wrote:

> Date: 8 Jul 98 18:28:08 -0500
> From: Bruce Anderson <brucea@wavefront.com>
> To: NetBSD Users <netbsd-users@NetBSD.ORG>
> Subject: Re: Tar and Find Problem
> 
> Fixing find is simple enough : find . -mtime -type f > <somefile>
> Is there a problem with tar?
> example: 
> % find /tmp -mtime 1 -type f |tar cvf my.tar -
> tar: can't add file - : No such file or directory
> 
> Well?
> 
> On Wed, Jul 8, 1998 5:09 AM, Torsten Schlueter <mailto:t.schlueter@gmx.de>
> wrote:
> > Hi,
> > I was trying to update my Homepage when i noticed that it is not
> > possible (for me) to put only those files in an tar archive which were
> > changed.
> > 
> > I tried the following:
> > 
> > t-rex://usr/local/httpd/htdocs/ #find . -mtime 1 -print
> > 
> > and the output were the files which are changed today.
> > 
> > trying 
> > tar -cvzf webneu.tgz -T /tmp/webneu.files (after creating the file
> > /tmp/webneu.files) or
> > tar cf ~/webneu.tar `find . -mtime 1 -print`
> > has the same result. The whole directory is added to the archive. 
> > 
> > Whats wrong with those commands?
> > 
> 
>  
> ----------------------------------------------------------------
> This message was created and sent using the Cyberdog Mail System
> ----------------------------------------------------------------
> 
> 
>