[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find command



> find /var/log/radius/ -path '/proc*' -prune -o -newer /etc/raddb/03.tmp
> -exec tar cv {} -f /backup/rs.tar \;
> 
> 03.tmp is Mar 31 23:59
> i want to to tar all newer or changed file into the file rs.tar but it
> start to tar all the files.
> 
> find /var/log/radius/ -path '/proc*' -prune -o -newer /etc/raddb/03.tmp
> -exec du -h {} \;    this works just find

1. Each addition or deletion of a file and/or directory, causes the
   parent directory to be "updated".
2. When you tar a directory, all of its contents and sub-contents
   are tarred too.

Combine these two facts, and you'll understand why all the files
are tarred.

A possible workaround: Add "-type f" to your find.
Note: The command you mentioned will cause the file pathes to begin
with "/". It is recommended to enter to the top of the hierarchy
and to use "." instead of "/something", or simply playing with the
flags of find to achieve a similar effect.

-- 
Eli Marmor