Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

robocopy MAXAGE / MINAGE value with hours and minutes

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

like image 763
Sun_Sparxz Avatar asked Jun 24 '13 21:06

Sun_Sparxz


1 Answers

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

like image 150
CrommCruach Avatar answered Oct 05 '22 22:10

CrommCruach