robocopy MAXAGE / MINAGE value with hours and minutes

落花浮王杯 提交于 2020-01-03 08:44:09

问题


I am trying to copy files from server to another server every hour as files being created. I was using Robocopy for copying file, and its very useful. But now I am really stuck with this. I need to copy files with MINAGE value of minutes, something like that.

if i ran robocopy after 2pm, i should able to copy only file which created before 2PM

Robocopy MAXAGE and MINAGE only accepts date not time.

Any suggestion


回答1:


Why u don't use the MIR function and run the job every 60 min via task scheduler?

Another way could be: /mot: Monitors source, and runs again in M minutes if changes are detected.

My last resort (non robocopy way):

Copy-Item c:\src\*.* -filter (Get-ChildItem | Where{$_.CreationTime -ge (Get-Date).AddMinutes(-60)}) "C:\dest\"

You could that even run via task scheduler




回答2:


xxcopy has better granularity in date/time.




回答3:


MINAGE and MAXAGE refer to the creation date of the file.

MINLAD and MAXLAD refer to the last write time of the file.

Use a combination of both.

Source: http://social.technet.microsoft.com/Forums/scriptcenter/en-US/b5cb685e-32f6-4eed-855d-e710ca4b203f/what-is-the-date-in-robocopys-minage-



来源:https://stackoverflow.com/questions/17285720/robocopy-maxage-minage-value-with-hours-and-minutes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!