Reece
Reece

Reputation: 797

Robocopy making two copies of Music, Pictures and Videos directories

I'm using a robocopy script to backup AD user's data to a NAS upon system shutdown and I'm finding that the Music, Pictures and Videos directories are being copied to two locations - the root folder, and into the Documents directory. Essentially filling up the storage drive at double the expected rate.

To me, this is similar to when Windows XP used to store those media directories within My Documents. But I don't know why it is happening in my robocopy script and how to stop it.

My script is as follows:

@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"

Upvotes: 0

Views: 421

Answers (1)

Gary Sims
Gary Sims

Reputation: 26

After searching around for the same issue, I set the /XJ switch in Robocopy which appears to have fixed the problem.

Upvotes: 1

Related Questions