0

There are over 1m+ cache files in one directory on a server. I would need to remove them, but of course rm first lists file and then starts to remove them. That cause a high spike in a server CPU load and can cause whole server to break down. Any ideas how to safely remove them without causing any harm?

1

1 Answer 1

2

If you value more cpu usage than speed on the erase, this is a good approach:

find <dir> -type f -exec ionice -c3 rm {} \; 

Replace \; with + if you want some more speed (and more cpu).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.