I have to find those files which have been modified before one day. There are lots of files which are modified before one day. I am doing find ./ -type f -mtime -1. But, I observed that my disk util went to 100%. It was probably because of the access time modification for each file. Is there any way to find files without modification of the access time?
|
|
||||
|
Your disk usage spiked high because the find was scanning through a lot of directories. Your disk usage monitor is probably reporting both reads and writes in the same graph. Often, if you do several finds in a row on the same directory structure, the subsequent finds do not access the disk because all the disk blocks the find needs (i.e. the directory listings) are cached in memory from the previous find. Other than having the blocks already cached in memory, there is no way to reduce the disk load of a find operation (well, you could nice it or stick a sleep in there, but that wouldn't reduce the number of disk accesses required). |
|||
|
|
|
Normally eg :
Output
|
|||
|
|
|
You may want to mess with the I believe there is now very little reasons to keep the filesystem updating its More info there : http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html (I took the first link when I searched for "noatime" in my search engine... Should be good enough, but you can probably find more info elsewhere) |
|||
|
finddoesn't modify theatimeof files. – bahamat Nov 26 '12 at 7:49find, disk usage goes up. What makes you think that find updated the atime for the files? – Michael Kjörling Nov 26 '12 at 10:20