Info on find/ls mtime,atime,ctime

From: Chela Kunasz <chela_at_jila02.Colorado.EDU>
Date: Fri, 10 Nov 1995 11:05:50 -0700

Hi Alpha-OSF-managers,
I have been asked to write a script which will identify all files
and directories which have not been "in use" for more than 90 days.

     1. In pondering this, I have concluded that I don't fully
        understand the meaning of mtime, atime and ctime as
        options for the "find" command. I understand that
        these mean "modified", "accessed", and "changed".
        How do "modified" and "changed" differ from each other?
        Does the first refer to content only, the other content+
        permissions, ownership etc.? Or?
                
     2.It seems that if a file is created (e.g. .cshrc for a new user)
             then if that file is created but NEVER accessed, it will not
        show up in the list of files with accessed time greater
        than 90 days, even if it were created 1 year ago. (because
        it has never been accessed?). Certainly this file has not
        been "in use". What does "accessed mean?" Does "cat" access
        a file; does f77 access a fortran source code which it compiles?

     3. What I'd really like is an "ls" (with a -R option) which would
        display access times (with a default to creation time) if no
        access time exists. I have seen that stat exists as a C-callable
        system routine which might provide some help. Has anyone written
        a code like the modified ls I'm describing above? The problem
        with the current ls is that it only displays the file modification
        time and one can't really tell what the most recent "use time" of
        the file was...

     4. When I try find . \( -atime +90 -o -ctime +90 \) -exec ls -las {} \;
        then I get a not-so-useful printout which includes lots of files
        which modify dates which are recent. If I leave out -ctime then
        for files which were created long ago but never accessed or
        modified, then these are not listed...

Any suggestions? Any scripts or hacked commands to get this info?

     5. The truly frightening part is that the person wanting this
        information wants to use this in a procedure which first
        presents a list of all files owned by a subgroup of users
        to them for perusal, and then have me execute a script or
        command which will DELETE all these files. I have tried
        explain the obvious pitfalls of this plan to deaf ears. Since
        I can't stop this plan, I would like to at least provide a
        script whose behavior I understand and can explain clearly
        so all are properly warned and will provide users ways to
        touch their files to preserve files (such as
        find ~homedir \( -name ".*" -o -name "*" \) -exec touch -c {} \;

        I know this sounds crazy but this is happening...

chela kunasz
Received on Fri Nov 10 1995 - 19:41:07 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT