Video Screencast Help

Utility to create file listing that shows offline attribute?

Created: 07 Jan 2013 • Updated: 08 Jan 2013 | 8 comments
This issue has been solved. See solution.

I'm about to do a bulk recall of a lot of data using FSAUtility -b.  I work in an industry where you often have to validate the tools you're using work as advertised.  So I need a utility or command line tool that will allow me to get a full recursed file listing of a target directory, showing me date and time stamps as well as file attributes (including the offline attribute).

Anyone know of such a creature?

If not, has anyone ever had to "validate" FSAUtility's bulk recall before?  I need to show the set of files in a target directory are the same before and after the recall.  I'll have to base the compare solely on timestamps b/c the placeholder is obviously different from the recalled original.

 

Thanks!

Comments 8 CommentsJump to latest comment

AndrewB's picture

what about something like dir /a /s > listing.txt ?

Andy Becker | Authorized Symantec Consultant | Trace3 | Symantec National Partner | www.trace3.com

Rob.Wilcox's picture

Windows Explorer can do this if you do a search for *.*, show 'details' and then add the column in for 'attributes'.

 

Or.. am I missing a nuance of what you're after?

RhoSysAdmin's picture

The "dir" command doesn't show the attributes, and the "attrib" command doesn't show the offline (-O) attribute.

A search from Windows Explorer will show me what I want to see ( all files in a source directory w/ their date and time stamps and attributes), but there's no way I know of creating a PDF or a report in some other format.

I need a report to show what I have before and after the recall.

 

Rob.Wilcox's picture

A few options..

a/ Dir /N

This will list offline files with their size in brackets ...

<snip>

C:\Data>dir /N

 Volume in drive C has no label.

 Volume Serial Number is 7CB3-3D1B


 Directory of C:\Data


03/01/2013  10:59    <DIR>          .

03/01/2013  10:59    <DIR>          ..

21/12/2012  14:25          (47,089) items to archive.linq

21/12/2012  16:07                 4 readme.txt.txt

21/12/2012  16:36            12,486 test.docx

               3 File(s)         59,579 bytes

               2 Dir(s)  120,554,536,960 bytes free
 

</snip>

Use some script-action:

 

<snip>

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Const ForAppending = 2

Dim objFSO:Set objFSO = CreateObject("Scripting.FileSystemObject")


LogFile = "c:\exportme.log"

Dim objLogFile:Set objLogFile = objFSO.CreateTextFile(logfile, 2, True)


objStartFolder = "C:\data"


Set objFolder = objFSO.GetFolder(objStartFolder)

objLogFile.Write objFolder.Path

objLogFile.Writeline

Set colFiles = objFolder.Files

oStr=""


For Each objFile in colFiles


    oStr = ""


    oStr = objFile.Name & " : " & objFile.Attributes

    ' Do a bit of manipulation on Attribute value

    if objFile.Attributes AND 1024 then

oStr = oStr + " REPARSE"

    end if

    objLogFile.Write oStr

    objLogFile.Writeline

Next


objLogFile.Writeline


ShowSubfolders objFSO.GetFolder(objStartFolder)


Sub ShowSubFolders(Folder)

    For Each Subfolder in Folder.SubFolders

        objLogFile.Write Subfolder.Path

        objLogFile.Writeline

        Set objFolder = objFSO.GetFolder(Subfolder.Path)

        Set colFiles = objFolder.Files

        For Each objFile in colFiles

oStr=""


oStr = objFile.Name & " : " & objFile.Attributes

' Do a bit of manipulation on Attribute value

if objFile.Attributes AND 1024 then

oStr = oStr + " REPARSE"

end if

objLogFile.Write oStr

       objLogFile.Writeline

        Next

        ShowSubFolders Subfolder

    Next

End Sub


objLogFile.Close

</snip>

 

That outputs :

<snip>

 

C:\Users\administrator.EV>type c:\exportme.log

C:\Data

items to archive.linq : 1056 REPARSE

readme.txt.txt : 32

scanfs.vbs : 32

test.docx : 32


C:\Data\test1

fred.txt : 32

</snip>

AndrewB's picture

check this out https://www-secure.symantec.com/connect/downloads/...

Andy Becker | Authorized Symantec Consultant | Trace3 | Symantec National Partner | www.trace3.com

SOLUTION
RhoSysAdmin's picture

The script is a great place to start.  The only issue is that it either gives me a listing of everything or nothing, depending how we tweak the where. 

-eq doesn't display any offline files

-ne displays all files, including offline files

I have a coworker who knows a little powershell.  We're going to try to tweak it.

Thanks!

RhoSysAdmin's picture

My coworker was able to tweak it so I get a listing of what we need.  We're going to create two different csv's:

 

# Create detailed listing of just the Offline files (EV placeholders)
Get-ChildItem $fldr -recurse | Where-Object {$_.Attributes -like '*Offline*'} |
 select PSDrive, DirectoryName, Name, Mode, Length, IsReadOnly, FullName, CreationTime, LastWriteTime, Attributes |
 Export-Csv "$csvfldr\OfflineFiles.csv"

# Create detailed listing of all files
Get-ChildItem $fldr -recurse |
 select PSDrive, DirectoryName, Name, Mode, Length, IsReadOnly, FullName, CreationTime, LastWriteTime, Attributes |
 Export-Csv "$csvfldr\AllFiles.csv"