[nflug] copy (cp) large number of files

Robert F. Stockdale IV javabob at adelphia.net
Wed Apr 26 05:07:11 EDT 2006


Thank to all who helped. Since I had already copied the files to the new partition and all I 
had to do was move them to the parent directory I was successful using the find command. I used:

find /mnt/mus/multimedia -type f -exec mv -p {} /mnt/mus/ \;

I can't believe I had such trouble when there are so many options.
Thanks again.
Bob

Sam Stern wrote:
>  
> 
> 
>>-----Original Message-----
>>From: nflug-bounces at nflug.org [mailto:nflug-bounces at nflug.org] 
>>On Behalf Of joshj at linuxmail.org
>>Sent: Tuesday, April 25, 2006 02:40 PM
>>To: nflug at nflug.org
>>Subject: RE: [nflug] copy (cp) large number of files
>>
>>THE RESULTS
> 
> <snip>
> 
>># This creates olddir in newdir even if newdir doesn't exist.
>>time rsync -av olddir newdir >/dev/null
>>
> 
> 
> You left off the trailing slashes:
> 
> rsync -aq olddir/ newdir/
> 
> This will copy all the directories under olddir/ to newdir/ and be rather
> quiet about it. For The opposite effect, try rsync -aP ;>
> 
> 
>>
>>
>>
>>The 'find' method broke the directory structure. So if you have
>>multiple files with the same name but in different directories then you
>>will lose data. Only the first two methods did not require the creation
>>of new directories (which I think was a prerequisite of the original
>>post since it was a mounted directory). I think that the tar method can
>>do this too but I couldn't figure it out.
>>
> 
>  
> You have a good point about files with the same name. It will be difficult
> to merge all the files into a single pool if there are duplicate file names
> without a bit of scripting. Fortunately, it seems someone had a similar
> problem some time ago and wrote some nice scripts to address the problem:
> 
> I found a tool called FSLint, which seems perfect for this task. It's a
> bunch of nice scripts and a gui. The script you want form that collections
> is: findsn 
> 
> http://www.pixelbeat.org/fslint/
> 
> 
> So the question for Bob is probably "What did you want -- all the files
> merged into a single directory or all the directories just copied into the
> new drive but preserving the old directory layout?". 
> 
> If you want to preserve the old layout, "cp -rp /mnt/mus/multimedia/*
> /mnt/mus/" is probably your best bet 
> 
> If you want to merge all the files into one huge directory, then you should
> first dupe check the files (findsn /mnt/mus/multimedia). Rename the dupes
> you find and then use "find /mnt/mus/multimedia -type f -exec cp -p {}
> /mnt/mus/ \;" AFTER you dupe check and rename.
> 
> 
> Sam S.
> 
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
> 
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list