Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We are looking to generate a report that would let us know when files in our archive were last accessed. We are trying to determine which files can be moved to lower cost and slower storage devices, since they are not being accessed.

These are a mix of servers with NAS on them (all NTFS formatted). I was thinking of something like the 'tree' command, outputted to a text file with the date last accessed.

I'm more of a *nix guy, so I'm just not as familiar with how you would do something like this on Windows..

share|improve this question
    
What about a Samba client so that you can use the *nix tools you are used to using? –  hydroparadise May 7 '12 at 20:45
    
They have "old file" seekers back in XP, one of them is called "findUnusedfiles" it was gui based. Last access was not always updated as expected for everything, so the results for system files still required a lot of user decision, should work for this. I think that win7 comes out with last access tagging off by default. >fsutil behavior set disablelastaccess 0 <-- if anyone needs that. –  Psycogeek May 8 '12 at 5:45
    
That's a fantastic idea! Thanks!! –  bgarlock May 14 '12 at 13:25

1 Answer 1

with powershell, this will give you all files in the c:\temp folder with last access time greater than 2 months. It will write the result to a file - c:\files.log:

foreach ($i in get-childitem c:\temp -recurse ) {if ($i.lastaccesstime -lt ($(Get-Date).AddMonths(-2))) {write-output $i.fullname,';'$i.lastaccesstime | out-file -filepath "c:\files.log" -append}}

It is on one line !

share|improve this answer
    
Excellent! I can get my feet wet with Powershell. I also like the idea of using *nix samba tools, as @Psycogeek suggested above.. I like this answer a lot too. –  bgarlock May 14 '12 at 13:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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