Windows Server 2003 Date Accessed information on files

155 pts.
Tags:
Robocopy
Windows scripting
Windows Server 2003
I am trying to [strong]move[/strong] files based on the last accessed time of the file being 2 days, using Robocopy. I am using the /MOVE switch that deletes the file after it is copied. The script works but not on nearly as many files as I expected it to. In trying to figure out the problem, I select the properties of a random file remaining within the source directory or subdirectory. In most cases, the last accessed date shows as the time I ran the robocopy batch file. So of course the files would not move based on the last accessed date being only a few minutes old. I then check the last accessed time of the files that did move to the target folder. They seem to change to the exact time I am viewing this property window of the file. One thing to note is a difference found between files on the source and files on the target, is that the ownership changes from a wide variety on the source to them all being set to the local admin account on the target directory. This is also the account used to run the Robocopy batch file. Any idea what is going on?

Software/Hardware used:
Windows 2003 R2 SP2 server 64 bit , HP BL20P

Answer Wiki

Thanks. We'll let you know when a new response is added.

The command is probably working as it should, you just need to refine the options.

As for permissions, you can add /COPY:DATS to copy security permissions otherwise, NTFS will set inherited permissions from the parent folder.

You should probably avoid MINLAD because last access time is very sketchy. The second someone clicks on the file in explorer, it is accessed. If you want files not modified after 2 days you can use /MINAGE:2

I can get you a better command, if you let us know exactly what you are trying to accomplish. Hope this helps.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • mshen
    What is the command you are using? It would help if you posted the relevant portions of your script.
    27,385 pointsBadges:
    report
  • MicJ
    Here is the command: C:Toolsrobocopy "c:SourceDir" c:DestDir /s /MINLAD:2 /R:3 /W:3 /MOVE /NP /XD NoPurge >C:toolsTodaysPurges.log
    155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following