A few more notes, after a msg by Marshall.

noatime completely disables atime updates. This can be useful for files where atime is irrelevant, like everything in /bin, /sbin, /lib, /usr/bin, /usr/sbin, /usr/lib. No one cares when /bin/bash was read last. On a desktop / server, where disks rotate continuously, the atime update does not matter, but on a laptop or on flash media, like CF- (DIY firewall) or SD-cards (Raspi), each atime update means a disk update / a write cycle. So mounting those directories, or perhaps the entire root fs with noatime makes sense there. /home, /tmp and /var (or at least parts of /var) would live on a different filesystem with different mount options. If set up cleverly, the root fs could also be mounted read-only, preventing all updates including atime.

strictatime is the classic unix behaviour. Update atime everytime a file is read.

relatime is a clever hack. The atime is updated, but only if the previous atime was earlier than the current mtime or ctime. This helps programs like mutt to detect that a file has been read since the last modification. Newer Linux versions (>= 2.6.30) also update atime if the difference is larger than one day. Default since 2.6.30.

Then, there is also lazytime. This updates atime, ctime, and mtime only in memory. For userspace, this should look like strictatime, but time changes require no disk access, so disks can be stopped, flash write cycles are prevented. Times are written to disk / flash only if something else changes in the inode, on fsync/syncfs/sync (e.g. from umount), when the (undeleted) inode is removed from memory, or more than 24 hours have been passed since the last write for the inode. Of course, if you need the atime/ctime/mtime in software, you don't want an unexpected power cycle or a crash, because all unwritten updates would be lost.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: Analyzing Files Within a Directory by afoken
in thread Analyzing Files Within a Directory by xc63

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.