There is a really neat post on Adi Oltean’s Blog concerning the use of Windows 2008 R2′s File Management Tasks (FMTs) to archive data. He uses a “Custom” task type and refers to a batch script which moves files and leaves a symbolic link. This is sort of a “poor man’s” HSM solution, admittedly, but still pretty cool and instructive as to what can be accomplished with FMTs (anything you can script!). His script is below:
if exist "c:\protected\%~pnx1" @echo Target file already exists! & goto :EOF md "c:\HSM\%~p1" move %1 "c:\protected\%~p1" mklink %1 "c:\protected\%~pnx1"
If you are wondering (like I was) what the heck “%~p1″ or “%~pnx1″ means, check out this site.
I set up a similar FMT in my test environment to learn about this technology, but I had problems with Adi’s batch script. It was hard to debug because it has no logging, so I wrote my own in VBS with lots of logging. You can download my script here. Here is how I set up my FMT.
1. On the General tab enter a task name and the Scope. The scope is where the FMT run against.
2. On the Action tab choose “Custom” for the Type. For the Executable section enter the path to cscript.exe. In the Arguments section enter the path to the script (download above), and choose the [Source File Path] variable to insert. Command Security should be set to Local System.
3. On the Condition tab place a check mark inside the Days since file was last accessed box. Note the property conditions section of this tab. Here you can add file classifications you have previously set up. For a great read on Microsoft’s File Classification Infrastructure read the Storage Team’s blog about it. Note, if you want to use “Last Accessed” time for your FMT as I did you need to enable the tracking of this attribute. This is done by setting HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate to 0 (this value is REG_DWORD). Note that this could impact disk IO performance on busy file servers!
4. On the Schedule tab enter whatever schedule/frequency is desired.
Finally, use a Windows “Touch” utility (download one here) to alter the Last Accessed date of a file that falls within the scope of the FMT you created. Then manually run your FMT (Right-click > Run Now) and if all is well the file you altered should be moved and a symbolic link left in it’s place.



