robocopy MAXAGE/MINAGE 值,带小时和分钟 [英] robocopy MAXAGE / MINAGE value with hours and minutes

查看:201
本文介绍了robocopy MAXAGE/MINAGE 值,带小时和分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在创建文件时每小时将文件从服务器复制到另一台服务器.我正在使用 Robocopy 来复制文件,它非常有用.但现在我真的坚持这个.我需要复制 MINAGE 值为分钟的文件,类似这样.

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.

如果我在下午 2 点之后运行 robocopy,我应该只能复制下午 2 点之前创建的文件

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

Robocopy MAXAGE 和 MINAGE 只接受日期而非时间.

Robocopy MAXAGE and MINAGE only accepts date not time.

任何建议

推荐答案

为什么不使用 MIR 功能并通过任务调度程序每 60 分钟运行一次作业?

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

另一种方式可能是:/mot:监控源代码,如果检测到更改,则在 M 分钟后再次运行.

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

这篇关于robocopy MAXAGE/MINAGE 值,带小时和分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆