ADSM-L

Re: Windows NTFS last accessed date set by TSM client

2002-03-27 15:19:34
Subject: Re: Windows NTFS last accessed date set by TSM client
From: Pete Tanenhaus <tanenhau AT US.IBM DOT COM>
Date: Wed, 27 Mar 2002 15:18:08 -0500
The last access date/time of an NTFS file is only updated if the file is
backed up, it isn't updated
during incremental backup scan processing.

Most virus protection software modifies the last access while scanning the
file system for viruses but
resets it to the original value unconditionally.

The TSM backup client currently doesn't reset the last access time but
development is considering
adding an option to allow it to be reset to the original value prior to
backup.

The attached program will dump out the time stamps of an ntfs file.

Running this program against an ntfs file before and after backing up the
file should
demonstrate the last access date changing.

Hope this helps .....

Pete



----------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <windows.h>
#include <windows.h>
#include <stdio.h>

static TCHAR * getLocalTimestamp (FILETIME *ftP, TCHAR *buff);

void wmain (int argc, wchar_t *argv[])
{
   WIN32_FIND_DATA fd;
   HANDLE          hFind;

   TCHAR           buff[100];

   if (argc < 1)
      return;

   if ( (hFind=FindFirstFile(argv[1], &fd)) == INVALID_HANDLE_VALUE )
   {
      wprintf(L"\n\nFindFirstFile: Win32 RC=%d.\n\n", GetLastError());
      return;
   }
   FindClose(hFind);

   wprintf(L"\n%s :\n", argv[1]);
   wprintf(L"   Creation    Time: %s\n"   , getLocalTimestamp
(&(fd.ftCreationTime), buff));
   wprintf(L"   Last Access Time: %s\n"   , getLocalTimestamp
(&(fd.ftLastAccessTime), buff));
   wprintf(L"   Last Write  Time: %s\n\n"   , getLocalTimestamp
(&(fd.ftLastWriteTime), buff));

   return;
}


static TCHAR * getLocalTimestamp (FILETIME *ftP, TCHAR *buff)
{
   FILETIME        ftLocal;
   SYSTEMTIME      stLocal;

   FileTimeToLocalFileTime(ftP, &ftLocal);
   FileTimeToSystemTime(&ftLocal, &stLocal);

   wsprintf(buff, L"%04d %02d/%02d %02d:%02d:%02d:%03d",
           stLocal.wYear, stLocal.wMonth, stLocal.wDay, stLocal.wHour,
           stLocal.wMinute, stLocal.wSecond, stLocal.wMilliseconds);

   return buff;
}
-----------------------------------------------------------------------------------------------------------------------------------------------
Pete Tanenhaus
Pete Tanenhaus
Tivoli Storage Solutions Software Development
email: tanenhau AT us.ibm DOT com
tieline: 320.8778, external: 607.754.4213

"Those who refuse to challenge authority are condemned to conform to it"

---------------------- Forwarded by Pete Tanenhaus/San Jose/IBM on
03/27/2002 03:03 PM ---------------------------
03/27/2002 03:03 PM ---------------------------

Alex Paschal <AlexPaschal AT FREIGHTLINER DOT COM>@VM.MARIST.EDU> on 03/27/2002
01:54:02 PM

Please respond to "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>

Sent by:    "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>


To:    ADSM-L AT VM.MARIST DOT EDU
cc:
Subject:    Re: Windows NTFS last accessed date set by TSM client



Andy,

What exactly is the issue?  Personally, during my testing, it looked like
the TSM client maintained the last access date and NTFS didn't
automatically
update the Last Access date as you describe when TSM accessed the file (on
WinNT4 SP6, I think).  The updated access time issues I encountered had to
do with interoperability with the McAfee virus scan software.  Here is the
message I posted with one of my actual tests copied and pasted in it.
http://msgs.adsm.org/cgi-bin/get/adsm0109/460.html

I believe your statement that NTFS updates the Access Date when TSM access
the file possibly occurs under situations I didn't test.  Could you give us
more detail?


Thanks,
Alex Paschal
Storage Administrator
Freightliner, LLC
(503) 745-6850 phone/vmail