简体   繁体   English

在批处理文件中执行复制命令

[英]executing copy command in a batch file

I'm using a windows copy command to perform auto file backup of Microsoft outlook files for a domain users. 我正在使用Windows Copy命令为域用户执行Microsoft Outlook文件的自动文件备份。 the problem exists after 6 month of using this batch file is that the .pst file size for each user is growing and the copy operation is getting too long to complete. 使用此批处理文件6个月后存在的问题是,每个用户的.pst文件大小正在增加,并且复制操作太长而无法完成。

i want to know are there any way to copy only the changed bits in the .pst file couse what i'm doing is copying the whole file each time a user login. 我想知道有什么方法可以只复制.pst文件中的更改位,因为我正在做的是每次用户登录时都复制整个文件。

copy  C:\"Documents and Settings"\%USERNAME%\"Local Settings"\"Application Data"\Microsoft\Outlook\ \\storage\folder1\folder2\%USERNAME%\%DESTDIR% /y /v

thanks 谢谢

此页面可能会帮助您做到这一点: 链接

In a word: with the regular Windows copy command, no. 一言以蔽之:使用常规Windows copy命令,否。

You've a few alternatives, though. 不过,您还有其他选择。 Probably the best is to ask your users (or get your administrator) to reduce the size of the mailbox. 最好的办法是让您的用户(或让您的管理员)减小邮箱的大小。

Another is to try the robocopy utility, which is part of the Windows Server Resource Kit and which replaces xcopy in versions of Windows above Server 2008 R2. 另一种方法是尝试使用robocopy实用程序,该实用程序是Windows Server资源工具包的一部分 ,它将替代Server 2008 R2以上的Windows版本中的xcopy In my experience this is a little faster. 以我的经验,这要快一些。 It also includes an option to skip the copy if the file hasn't changed, which may help if your users only use email infrequently. 它还包含一个选项,如果文件未更改,则跳过副本,如果您的用户仅很少使用电子邮件,则这可能会有所帮助。

rsync (details here , Windows version here ) does a true differential copy, so only the changed bytes between the files are copied. rsync (细节在这里 ,Windows版本在这里 ),做一个真正的差异性副本,所以才有了文件的字节变化被复制。 However this needs to be installed as a Windows service on the listening side and needs to be installed as a program on each client. 但是,这需要作为Windows服务安装在侦听端,并且需要作为程序安装在每个客户端上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM