Robocopy制作两份音乐,图片和视频目录

时间:2018-02-13 22:39:13

标签: windows-7 robocopy user-profile

我正在使用robocopy脚本在系统关闭时将AD用户的数据备份到NAS,我发现音乐,图片和视频目录被复制到两个位置 - 根文件夹,并进入Documents目录。基本上以预期速率的两倍填满存储驱动器。

对我而言,这类似于Windows XP用于在“我的文档”中存储这些媒体目录的情况。但我不知道为什么它会在我的robocopy脚本中发生,以及如何阻止它。

我的脚本如下:

@ECHO OFF
SETLOCAL

Set day=%DATE:~7,2%
Set mm=%DATE:~4,2%
Set dd=%DATE:~7,2%
Set yyyy=%DATE:~10,4%
Set RCLogFile=C:\backup-logs\%yyyy%%mm%%dd%_-_FileSync-Log.txt

SET _what=/MIR /COPY:DAT /DCOPY:T

SET _options=/R:0 /W:1 /FP /NDL /NP /TEE /XF "desktop.ini" ".DS_Store" "._Temporary Items" "._TemporaryItems" "*..RF" "thumbs.db" /XD ".AppleFileInfo" "Network Trash Folder" "TheFindByContentFolder" "TheVolumeSettingsFolder" "Temporary Items" "TemporaryItems"

MD C:\backup-logs 
ROBOCOPY "%userprofile%\Contacts" H:\Computer_Backup\Contacts %_what% %_options% /LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Desktop" H:\Computer_Backup\Desktop %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Documents" H:\Computer_Backup\Documents %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Downloads" H:\Computer_Backup\Downloads %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Favorites" H:\Computer_Backup\Favorites %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Links" H:\Computer_Backup\Links %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Music" H:\Computer_Backup\Music %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\Pictures" H:\Computer_Backup\Pictures %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\AppData\Roaming\Microsoft\Outlook" H:\Computer_Backup\Roaming\Outlook %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\AppData\Roaming\Microsoft\Signatures" H:\Computer_Backup\Roaming\Signatures %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\AppData\Roaming\Microsoft\Word" H:\Computer_Backup\Roaming\Word %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\AppData\Local\Microsoft\Outlook" H:\Computer_Backup\Local\Outlook %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"
ROBOCOPY "%userprofile%\AppData\Local\Google" H:\Computer_Backup\Roaming\Google %_what% %_options% /+LOG:"C:\backup-logs\%yyyy%%mm%%dd%_-_shutdown-backup.txt"

1 个答案:

答案 0 :(得分:1)

在搜索同样的问题之后,我在Robocopy中设置/ XJ开关似乎解决了问题。