The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: tar contains duplicate filenames
matt-baker
Newbie
Rank: 1



UID 256
Digest Posts 0
Credits 0
Posts 38
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 1, 2007 12:01 PM  Profile | P.M. 
tar contains duplicate filenames



tar contains duplicate filenames



i have a problem where tar is somehow creating duplicate filenames when tarring a directory. doing an ls on the directory does not show any duplicate filenames, yet when the directory is tarred, you can see that there are duplicates:



code:
bash-2.03# pwd
/var/log/cricket
bash-2.03# ls -1 | sort | uniq -d
bash-2.03# tar cvf /tmp/ctar.tar . >/dev/null
bash-2.03# tar tvf /tmp/ctar.tar | awk '{ print $nf }' | sort | uniq -d
./cricket24b.10
./cricket24b.79
bash-2.03# tar tvf /tmp/ctar.tar | grep ./cricket24b.10
-rw-r--r--   0/1    13328 mar 13 01:42 2007 ./cricket24b.100
-rw-r--r--   0/1    13330 mar 14 09:42 2007 ./cricket24b.10
-rw-r--r--   0/1    13331 mar 14 09:57 2007 ./cricket24b.10
bash-2.03# ls -l /var/log/cricket/cricket24b.10
-rw-r--r--   1 root     other      13331 mar 14 09:57 /var/log/cricket/cricket24b.10


Top
joh1
Newbie
Rank: 1



UID 208
Digest Posts 0
Credits 0
Posts 37
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 1, 2007 12:01 PM  Profile | P.M. 
are there hard links?
Top
aju_kup
Newbie
Rank: 1



UID 18
Digest Posts 0
Credits 0
Posts 35
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 1, 2007 12:02 PM  Profile | P.M. 
quote:
are there hard links?



there are no hard links, at least not for this specific file

-rw-r--r-- 1 root other 13331 mar 14 09:57 /var/log/cricket/cricket24b.10

the link count=1

are you really suie we are dealing with duplicate file names?

it could be that 1 file actually has the name as you see it. the other one could contain non printable characters in its name, which makes it look as if the file has the same name.


you could try the command:


code:

ls -l /var/log/cricket | grep "mar 14 09:"

and see if it looks like duplicate names pop up.

if this is the case you can try the command:


code:

ls -lb /var/log/cricket | grep "mar 14 09:"

which should show the file names actually differ.

this is all assuming the time stamps of the files haven't changed.
Top
fjj0924
Newbie
Rank: 1



UID 994
Digest Posts 0
Credits 0
Posts 1
Reading Access 10
Registered Jun 12, 2007
Status Offline
Post at Jun 12, 2007 09:10 PM  Profile | P.M. 
Moving files to a Web server share


Has anyone dealt with jobs that move files to web share?
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:30 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005305 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP