Solved

I have a 2TB folder with many subfolders on Server 2012.  I want to archive off the folders that have not been accessed within a given period of time.  Say 365days.

Posted on 2015-02-18
22
104 Views
Last Modified: 2015-02-24
My title really says it all:  I have a 2TB folder with many subfolders on Server 2012.  I want to archive off the folders that have not been accessed within a given period of time.  Say 365days.  There is no need to keep folders on a production File Server that has not been accessed.  I understand that storage is low in price, but management, DR, recovery is not.  

Any help or guidance would be appreciated.

Regards,
0
Comment
Question by:sXmont1j6
  • 10
  • 7
  • 5
22 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 40616520
what scripting/programming languages are you familiar with.
Where if anywhere do you want those files to go?

It is a fairly simple proposition/logic.
On the server having a destination.
You can get unixtoolsforwinfows which include the command find.
atime access time
ctime create time
mtime modify time
find . -atime +365
Will return a list of all files that have not been accessed in more than one year.
.......

You need to have a clear plan in place before you start moving, what the final destination is and how you will retrieve the files if they are needed later on.
This question is merely the first step.
The next step would be to move files from the holding pen which is where the first step placed the files, to an archive/or backed up somewhere.
The next step is if someone needs a file that is not on production and is not in the holding pen, how do you find it?
0
 

Author Comment

by:sXmont1j6
ID: 40616532
Hi Arnold, Thank you for your reply.  

Yes, there are multiple steps beyond this, but that is not my question.  I just need to a way to get a csv file of all FOLDERS, not files, You answered the question based on files, I am not interested in finding files that have not been accessed, I am interested in the actual folders, which have not been accessed.

We have an "archived" NAS which contains all of the old data and users' could access it there.
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40616581
Do you want to just look at the first level of folders under the root, and archive if they have not been accessed, or do you want to drill down to every folder nested under the root at any level and if you find one low in the tree that has not been accessed then move it?

Have you actually run a report listing the current folders that meet your criteria, without actually moving them?  I'd be curious if it's a lot or not, you may find that more things update the last accessed date than you think, reducing the number of folders that appear unaccessed.

~bp
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 77

Expert Comment

by:arnold
ID: 40616596
One, anytime you scan the access time is updated on every device you check.
Such that using access time is useless on folders or anything else.

Presumably you have auditing setup on this share. If not you should consider setting it up. This way using/logging the access you can map what files are being regularly accessed. Then using this list shortened for using directories, you would be able to use as the guide post when traversing the storage identifying the directories that exist in the filesystem but are not referenced in your DB.
i.e. any event updates the date on the folders up the chain to the current date..

Tree structure with update that cascades up.
0
 

Author Comment

by:sXmont1j6
ID: 40616601
Hi Bill,
Thanks for the reply.

I just want to look at the first level of folders under the root.  And no, I have not ran a report.  I want to be able to run a report and export the report to csv.  From there, take a look and determine my next steps based on that report.  

Can I get other dates for a folder, such as last modified? last accessed?  last written too?
0
 

Author Comment

by:sXmont1j6
ID: 40616609
Arnold,

on a 2TB shared directory with MANY different subfolders, what type of auditing solution would you recommend?  Keep in mind, this directory is constantly being written to.  Well over 1GB of data is modified on it daily.
0
 
LVL 77

Expert Comment

by:arnold
ID: 40616638
windows includes auditing on shares/folders (properties of the folder, advanced tab, auditing.)
This data will be added into the event log/security I think.
as you noted that will grow rather fast. To automate this, you could if you have one setup an SNMPTRAPD server to which SNMPtraps can be sent. You would then add SNMP to this system and using evntwin (GUI) or evntcmd if you know the events to SNMPTRAP you wish to configure. As soon as an event into eventlog is added, an SNMPTRAP for this event will be sent to the server configured under the SNMP service on this server.
It does get involved. On the snmptrapd server the events are recorded and can be processed to perform the task to mark folders as accessed.
......

1GB of modified data could represent a range of files from 1G of files  or a single file.
On such a large volume, I would have thought you would already have auditing to locate a file if it goes missing to at least know who modified it last or who deleted it.

The other option is to migrate from the current file share based access to a document management system which will have the answers to all your questions after one year has passed.
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40616730
Windows typically has three core dates available for files and folders:

Create Date
Update Date
Read Date

For folders, just doing a DIR on the folder, or potentially browsing it in Explorer likely changes the Read Date.

Folders are a little interesting too, for things like the last Update Date.  That typically means the last time the folder contents changed, which means whenever a file is added or deleted.  But I don't think reflects the last update date of any file in it.

~bp
0
 

Author Comment

by:sXmont1j6
ID: 40616749
So there no way to get the answer that I am looking?  I am not fully understanding.
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40616774
My other concern with your automated approach of just moving folders when they appear unused is the people that reference that data.  It could get confusing for people trying to figure out where they find certain data files at any point in time, since they could be in the "live" repository, or in the "archive".  How will they know without looking at both?

I'd again suggest you try and determine how much data you really have that hasn't been looked at in a year, and why that is.  If it's a certain type of data like logs, or information on retired products, etc, then maybe you decide to place that type of information on the alternative storage based on that.

On the flip side, what are you going to do to items that were not accessed for a year, got moved off production, and then someone accesses or updates them?  Shouldn't they then return to the production node?  Just another thing to consider.

Sorry, I'm probably confusing you more than  solving your problem, not my intent.  I just have an approach where I like to think through all the details of things before I move forward with a solution.  I'm hoping these questions are helpful in raising some things you might not have thought about, rather than unsettle you.

Just to give you an idea of the current folders and their "age", you could do the following at a DOS command prompt.

DIR C:\BASEDIR\*.* /ad /od /ta
DIR C:\BASEDIR\*.* /ad /od /tc
DIR C:\BASEDIR\*.* /ad /od /tw


These will show you a list of the top level folders sorted by date.  The date displayed will be determined by the /t option where /ta = accessed date, /tc = create date, /tw = write date.

Let me know what that looks like.  It won't do the math to determine which folders are a year "old", but since it's sorted in date order you can scan down it looking for when they fall into the year grouping.

~bp
0
 

Author Comment

by:sXmont1j6
ID: 40616796
I think this will do the trick.   but can you finish the command and add how to export to a csv.  please and thank you.
0
 
LVL 53

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 40616831
Have to break away for a bit, but here's a small VBS that will get you some info.  Run it and pipe the output to a CSV file.

CSCRIPT //nologo mydir.vbs > folders.csv

' Specify folder to list folder from
sFolder = "c:\temp"

' Write header line
Wscript.Echo "Path,DateCreated,DateLastModified,DateLastModified"

' Create file system object
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")

Set oFolder = oFSO.GetFolder(sFolder)

' Process all folders in this folders
For Each oSubFolder In oFolder.Subfolders
   Wscript.Echo Quote(oSubFolder.Path) & "," & _
                oSubFolder.DateCreated & "," & _
                oSubFolder.DateLastAccessed & "," & _
                oSubFolder.DateLastModified
Next

' Add surrounding double quotes to a string
Function Quote(s)
   Quote = Chr(34) & s & Chr(34)
End Function

Open in new window

~bp
0
 

Author Comment

by:sXmont1j6
ID: 40616850
Bill Prew, Thank you!
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40617141
Glad that helped.

~bp
0
 

Author Comment

by:sXmont1j6
ID: 40626091
Bill,

LastAccessed does not work with Windows 7?  is that true?
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40626489
As far as I know, it is disabled by default in Windows versions after Vista, to save resources, but can be enabled.  Take a look at these links for some background and how to enable it.  The second one includes the registry setting that controls this.  Keep in mind a reboot is needed after changing this setting.

http://www.groovypost.com/howto/microsoft/enable-last-access-time-stamp-to-files-folder-windows-7/

http://www.febooti.com/products/filetweak/online-help/file-last-accessed-date.html

~bp
0
 

Author Comment

by:sXmont1j6
ID: 40626545
My issue is that the report above would not be accurate then, if that is not enabled.  The files are on Server 2012.
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 40626592
Well, yes, that is correct.  But that's a Windows config issue, nothing the script can do about that unfortunately.

~bp
0
 
LVL 77

Expert Comment

by:arnold
ID: 40626615
The only way to get accurate information is to enable auditing on the share and then recording the information in real time using SNMPTRAP or use powersheel/vb to process the eventlog to record which files/folders have been accessed.

Migrating from file shares to a document management system will provide you more control and possibly an accurate report on which files were recently accessed/modified. etc.
Document management systems provide what a file share without auditing does not which is versioning and tracking.
0
 

Author Comment

by:sXmont1j6
ID: 40628125
Thoughts?
0
 

Author Comment

by:sXmont1j6
ID: 40628128
Sorry, can you recommend a relatively in-expensive document management system?
0
 
LVL 77

Expert Comment

by:arnold
ID: 40628268
Alfresco is an open source  includes community option and paid support option.

Requires as any open source combination/assembly of other possible implements to get to the eventual setup that suits your needs.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

OfficeMate Freezes on login or does not load after login credentials are input.
Concerto Cloud Services, a provider of fully managed private, public and hybrid cloud solutions, announced today it was named to the 20 Coolest Cloud Infrastructure Vendors Of The 2017 Cloud  (http://www.concertocloud.com/about/in-the-news/2017/02/0…
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question