• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 122
  • Last Modified:

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.

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
sXmont1j6
Asked:
sXmont1j6
  • 10
  • 7
  • 5
1 Solution
 
arnoldCommented:
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
 
sXmont1j6Author Commented:
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
 
Bill PrewCommented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
arnoldCommented:
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
 
sXmont1j6Author Commented:
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
 
sXmont1j6Author Commented:
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
 
arnoldCommented:
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
 
Bill PrewCommented:
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
 
sXmont1j6Author Commented:
So there no way to get the answer that I am looking?  I am not fully understanding.
0
 
Bill PrewCommented:
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
 
sXmont1j6Author Commented:
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
 
Bill PrewCommented:
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
 
sXmont1j6Author Commented:
Bill Prew, Thank you!
0
 
Bill PrewCommented:
Glad that helped.

~bp
0
 
sXmont1j6Author Commented:
Bill,

LastAccessed does not work with Windows 7?  is that true?
0
 
Bill PrewCommented:
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
 
sXmont1j6Author Commented:
My issue is that the report above would not be accurate then, if that is not enabled.  The files are on Server 2012.
0
 
Bill PrewCommented:
Well, yes, that is correct.  But that's a Windows config issue, nothing the script can do about that unfortunately.

~bp
0
 
arnoldCommented:
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
 
sXmont1j6Author Commented:
Thoughts?
0
 
sXmont1j6Author Commented:
Sorry, can you recommend a relatively in-expensive document management system?
0
 
arnoldCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now