1

I have a tools directory /tools/tool_name that has hundreds of releases of the tool inside. I am trying to find an easy way of knowing what releases can be archived. Is there an easy way of finding which release directory have not had any of its files accessed in the past year?

A great example is /tools/cadence where there are hundreds or even thousands of versions of cadence in /tools/cadence. How do I find which versions can be archived off because no one has used them?

  • 1
    My usual "solution " for these situations is to insert a wrapper script in place of the original; have the wrapper log its invocation and then exec the original program. – Jeff Schaller Jul 22 '15 at 23:47
  • knowing your filesystem type (and options, as @mikel-rychliski pointed out) will determine whether you can solve this proactively with the atime attributes or if you'll have to attack this a different way (wrappers, auditing) – Jeff Schaller Jul 23 '15 at 2:50
1

In the unlikely event that your filesystem is mounted with strictatime or lazytime you could use:

find /tools -atime +365

However if your filesystem is mounted with relatime, then this information is not being recorded. This is usually done for performance reasons. You can check using the mount command:

$ mount
/dev/sda3 on / type ext3 (rw,relatime,data=ordered)
[..]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.