Robocopy 制作音乐、图片和视频目录的两个副本
Robocopy making two copies of Music, Pictures and Videos directories
我正在使用 robocopy 脚本在系统关闭时将 AD 用户的数据备份到 NAS,我发现音乐、图片和视频目录被复制到两个位置 - 根文件夹和文档目录。基本上以两倍于预期的速度填满存储驱动器。
对我来说,这类似于 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"
在四处搜索相同的问题后,我在 Robocopy 中设置了 /XJ 开关,这似乎解决了问题。
我正在使用 robocopy 脚本在系统关闭时将 AD 用户的数据备份到 NAS,我发现音乐、图片和视频目录被复制到两个位置 - 根文件夹和文档目录。基本上以两倍于预期的速度填满存储驱动器。
对我来说,这类似于 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"
在四处搜索相同的问题后,我在 Robocopy 中设置了 /XJ 开关,这似乎解决了问题。