Link to home
Start Free TrialLog in
Avatar of tnrchinna
tnrchinna

asked on

Delete lot of files in solaris

Hi,

I have lots of files (nearly 900000)in a directory and I need to remove files older than 30 days in a quick way.

I tried to execute  find . -name "*____.tmp"  -mtime +30 -exec rm -rf {} \;

but it is too long time.

Regards
Chinna
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

find . -name "*____.tmp" -mtime +30 | xargs rm -f
How about creating a temp directory and moving the files to the temporary directory, then remove the whole temp directory? Like this:

find . -name "*____.tmp"  -mtime +30 -exec mv {} /tmpdir \;
rm -rf /tmpdir
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tnrchinna
tnrchinna

ASKER

I tried all the ways, mentioned above only last one better than all. Initiating during downtime and it is still taking long time but no option.