O Wizards!
I'm trying to gen a list of files on a server which haven't been accessed or modified in the past six months.
I started out with stat(), but got "odd" results, so switched to ls using the -u and -c switches.
All well and good, right? Wrong. On three servers, no files show up in my report as being untouched for more than six months. On another, only one file "failed" the test. Then, on a fifth, I got a report listing 9,636 files (out of 10,434, a failure rate of over 92%). Finally, on the sixth server, I got what appeared to be a reasonable result: 3,011 files out of 14,600, for a rate of 20.6%.
Only the last of these results seems reasonable to me. For one thing, when I log onto a server and just do a vanilla "l" of a directory--say, /usr/local/...--I get file dates ranging back as far as 1997.
I use JDNs to compare the dates. On the server with a 92% failure rate, nearly all files had the same access and modification dates. This led me to suspect cloning, but since that just creates a binary image, the dates should be those on the master drive, not the date of the cloning, or so I've been told.
Any wisdom you might be able to share, or light to shed, will be appreciated.
Thanks!
Deane
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.