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
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
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
find . -name "*____.tmp" -mtime +30 -exec mv {} /tmpdir \;
rm -rf /tmpdir
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.