bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: tar bug.. Replaces the link or do not overwrites the file


From: Ramakrishna_Manchale
Subject: Re: tar bug.. Replaces the link or do not overwrites the file
Date: Sat, 17 May 2003 16:35:25 +0530




Hi Paul,

Thanks for the reply and interest shown.

The new option works as follows:

1. If there are any directory or links to directory ( folder ) do not over
write but retain the same. ( similar to -k "retain old " option ).
      If there is no directory ( Or link ), create the same.
2. Overwrite any files which are having the same filename and parent
directory name as that in the xxx.tar archive file. ( here behavior is to
overwrite if exists ).

Example

Original file structure:

Say your working dir is /data01/user1

and we have two more disks added and it is /data02/user1/  /data03/user1/

mkdir /data01/user1/master
mkdir /data02/user1/increment1
mkdir /data03/user1/increment2

mkdir /data02/user1/increment1/a
mkdir /data02/user1/increment1/b
mkdir /data03/user1/increment2/a1
echo "first pdf file" > /data03/user1/increment2/a1/a11.pdf
echo "first pdf file" > /data03/user1/increment2/a1/a12.pdf

cd /data01/user1/master
ln -s  /data02/user1/increment1/a a
ln -s  /data02/user1/increment1/b b

cd /data02/user1/increment1/a
ln -s /data03/user1/increment2/a1 a1
ln -s /data03/user1/increment2/a2 a2

cd /data03/user1
mkdir a
cd a
mkdir a1
cd a1
echo "new pdf file " > a11.pdf
cd /data03/user1
tar -cvf a.tar a

last step:
cd /data01/user1/master
tar -xvf /data03/user1/a.tar

I expect this tar -xvf ( and any option ) to overwrite the file
/data03/user1/increment2/a1/a11.pdf
cat /data03/user1/increment2/a1/a11.pdf need to display:
"new pdf file"  and not "first pdf file"

replacing the last step with following works fine for me but i need to
untar to a temporary location and copy it and space usage in temp space is
a issue. And if tar itself supports this, it helps

cd /data01/user1/master
\cp -r /data03/user1/a .

Hope things are clear.

Rgds,
Ramakrishna



                                                                                
                                                       
                      Paul Eggert                                               
                                                       
                      <address@hidden        To:       address@hidden           
                                        
                      DU>                      cc:       address@hidden, 
address@hidden, address@hidden               
                                               Subject:  Re: tar bug.. Replces 
the link or do not overwrites the file                  
                      05/17/03 10:40 AM                                         
                                                       
                                                                                
                                                       
                                                                                
                                                       




address@hidden writes:

> Please suggest any solution.

It sounds like you need a behavior that is somewhere between the Unix
behavior (which leads to all sorts of security problems) and the GNU
tar behavior.  Another switch is needed, I suppose.  But it's not
clear to me exactly what its semantics should be.  Since you
understand the problem better, perhaps you can suggest something.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]