Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, I have a query regarding t

Status
Not open for further replies.

smitanav

Programmer
Mar 10, 2003
28
0
0
IN
Hi All,
I have a query regarding the deleting of many files in a fast way.
Over the last few days, one program malfunctioned and when i noticed , it had created a log directory with nearly 2 million files in it.
I'm using find and rm to delete the files , but from last 10 hours still the deletion is going on.

Is there any quicker/dirtier way to delete these files. Running on Solaris 8

Thanks in advance
smitanav
 
Here are some thoughts: (this has happened to me, too)

Can you do an rmdir -r and then recreate the log directory? (That would probably still take a long time.)

If it were a filesystem with just that directory in it, you could also umount the filesystem, remove the filesystem, and then recreate it.

Or create a temporary filesystem, do a mv on the directory where the logs are, then umount the temporary filesystem and delete the filesystem.
 
Be VERY careful with this but you could just 0 the files first with cd: /into/the/full/directory/ then do: > *.log

This should just empty the files, then you can remove them, not sure if this will be any quicker?

Good Luck,
Laurie.
 
hi Bi and Tarn ,


i will try for this ! once i kept it deleting and it was utilizing 60% of CPU .i kept it deleting for more than 24 hours.

My server is online with telecomm system. so i was afraid to keep it like this.

let me try and will let you know the results.

thanks in advance
Smitanav
 
Thanks alot to both of you

your suggestion worked out . it took some 18 hours to delete all files

thanks a lot

Smitanav
 
I'm pleased you were able to resolve it.

Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top