Hi All,
i have a script that finds the file with .txt .zip .Z .gzip that are 3 days old in directory /abc/def and removes them
find /abc/def -name '0*.txt' -mtime +6 -exec rm {} \;
find /abc/def -name '0*.zip' -mtime +6 -exec rm {} \;
find /abc/def -name '0*.gzip' -mtime +6 -exec rm {} \;
find /abc/def -name '0*.Z' -mtime +6 -exec rm {} \;
Now the issue is the scripts results in high CPU utilization reaching close to 100%.
How can i optimize my script so that i does not result in high cpu usage.
Please Advice and let me know if any others details are needed.
Note: /abc/def directory contains a lot of files.