| Windows 7: I know this is simple but...... |
01 Jun 2011
|
| | Windows 7 Home Premium 64 bit |
I know this is simple but...... Hi All:
I am trying to use robocopy to simply backup My Documents from my PC to an external hard drive (Drive F). I would like to do the backup every other day so ideally, robocopy would copy changed files only.
I created a batch file as follows:
C:\Windows\system32\robocopy "C:\users\MYNAME\Documents" "f:\My Documents" /MIR /E
pause
-------------------------------------------------------------------------------------------------
The problem is that this batch files deletes everything in f:\My Documents.
As the screen is whizzing by, I can see references to "*EXTRA file" (screen dump attached). Can anyone help me with this simple issue???
Many thanks! | My System Specs |
| OS Windows 7 Home Premium 64 bit |
01 Jun 2011
|
| | |
The /MIR functionality instructs robocopy to mirror the source and the destination. So, if you have anything in F:\My DOcuments that doesn't match what is in the C:\location......you are going to have them removed from the destination. Is that what is happening here? | My System Specs | | System Manufacturer/Model Number Self-Built in July 2009 OS Windows 7 Ultimate x64 CPU Intel Q9550 2.83Ghz OC'd to 3.40Ghz Motherboard Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS Memory 8GB G.Skill PI DDR2-800, 4-4-4-12 timings Graphics Card EVGA 1280MB Nvidia GeForce GTX570 Sound Card Realtek ALC899A 8 channel onboard audio Monitor(s) Displays 23" Acer x233H Screen Resolution 1920x1080 Keyboard ABS M1 Mechanical Mouse Logitech G9 Laser Mouse PSU Corsair 620HX modular Case Antec P182 Cooling stock Hard Drives Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS Internet Speed 15/2 cable modem Other Info Windows and Linux enthusiast. Logitech G35 Headset. |
01 Jun 2011
|
| | Windows 7 Ultimate SP1 64-Bit Peterborough, England |
I had this document in my Vista folder from some time ago, it may be of help to you. Windows Robocopy File Backup Use Robocopy, which is built into Vista. Go to command prompt and type robocopy /? This will show you the settings. I use two main switches: /mir and /e
/MIR mirrors the destination to be the same as the source. So in your source location, if you move, delete, add anything, the destination will be mirrored. If you delete something in the source, it gets deleted in the destination. If you move a file from one folder to another in the source, it also gets moved in the destination. If you update a file and it is newer then the destination file will be overwritten with the newer one.
/E will copy any file that is newer or doesn't exist but doesn't remove files that have been moved or deleted in the source. So if you delete a file from the source, it will remain in the destination. If you move a file from one folder to another in the source, then the destination will contain two copies of the file, one in the old location and one in the new.
The /E switch is pretty much the same an incremental backup. Depending on what you are doing you might want to use the /MIR option. On my machine, I use /E for documents and pictures in case I accidentally delete something, since documents and pictures can be important. However, for my music directory, since WMP11 is constantly moving and renaming files as I organize my music, I don't want a bunch of extra files everywhere, so I use the /MIR switch just to mirror the backup to the source.
In my case, I have a batch file that runs every night and it looks like this:
robocopy "e:\Documents" "f:\Backup\Documents" /e
robocopy "e:\Pictures" "f:\Backup\Pictures" /e
robocopy "e:\Contacts" "f:\Backup\Contacts" /e
robocopy "e:\Favorites" "f:\Backup\Favorites" /mir
robocopy "e:\Mail" "f:\Backup\Mail" /mir
robocopy "e:\Music" "f:\Backup\Music" /mir
robocopy "e:\Videos" "d:\Backup\Videos" /mir | My System Specs | | System Manufacturer/Model Number HP Pavilion Elite 495UK OS Windows 7 Ultimate SP1 64-Bit CPU Intel Core i7 870 @ 2.93GHz Motherboard MSI 2A9C (CPU1) Memory 8Gb Dual-Channel DDR3 @ 664MHz Graphics Card nVidia GeForce GTX 460 1024MB dedicated RAM Sound Card Realtek HD Audio Monitor(s) Displays HP2310i Screen Resolution 1920 x 1080 Keyboard Logitech K750 solar-powered keyboard Mouse Logitech Wireless M180 mouse PSU 460W Case HP Elite Cooling Air cooled Hard Drives 1x1954GB Hitachi HDS22020ALA 330 (RAID), 1x1954GB Hitachi External for backup and storage Internet Speed 2Mb Other Info Pure Avanti Flow Internet Radio with iPod Dock, 64Gb iPod, HP USB Speakers, Sony MDR-V500 Headphones, Sony Vaio F-Series Laptop |
01 Jun 2011
|
| | Windows 7 Home Premium 64 bit |

Quote: Originally Posted by pparks1 The /MIR functionality instructs robocopy to mirror the source and the destination. So, if you have anything in F:\My DOcuments that doesn't match what is in the C:\location......you are going to have them removed from the destination. Is that what is happening here? PParks- thanks for your response. I copied all the docs from My Documents on my PC into the f:\My Documents folder. I then ran the batch file (as a test) which is what deleted everything on the external drive in f:\My Documents. | My System Specs | | OS Windows 7 Home Premium 64 bit |
01 Jun 2011
|
| | Windows 7 Home Premium 64 bit |

Quote: Originally Posted by seavixen32 I had this document in my Vista folder from some time ago, it may be of help to you. Windows Robocopy File Backup Use Robocopy, which is built into Vista. Go to command prompt and type robocopy /? This will show you the settings. I use two main switches: /mir and /e
/MIR mirrors the destination to be the same as the source. So in your source location, if you move, delete, add anything, the destination will be mirrored. If you delete something in the source, it gets deleted in the destination. If you move a file from one folder to another in the source, it also gets moved in the destination. If you update a file and it is newer then the destination file will be overwritten with the newer one.
/E will copy any file that is newer or doesn't exist but doesn't remove files that have been moved or deleted in the source. So if you delete a file from the source, it will remain in the destination. If you move a file from one folder to another in the source, then the destination will contain two copies of the file, one in the old location and one in the new.
The /E switch is pretty much the same an incremental backup. Depending on what you are doing you might want to use the /MIR option. On my machine, I use /E for documents and pictures in case I accidentally delete something, since documents and pictures can be important. However, for my music directory, since WMP11 is constantly moving and renaming files as I organize my music, I don't want a bunch of extra files everywhere, so I use the /MIR switch just to mirror the backup to the source.
In my case, I have a batch file that runs every night and it looks like this:
robocopy "e:\Documents" "f:\Backup\Documents" /e
robocopy "e:\Pictures" "f:\Backup\Pictures" /e
robocopy "e:\Contacts" "f:\Backup\Contacts" /e
robocopy "e:\Favorites" "f:\Backup\Favorites" /mir
robocopy "e:\Mail" "f:\Backup\Mail" /mir
robocopy "e:\Music" "f:\Backup\Music" /mir
robocopy "e:\Videos" "d:\Backup\Videos" /mir Thank you! I will give this a try. | My System Specs | | OS Windows 7 Home Premium 64 bit |
01 Jun 2011
|
| | |

Quote: Originally Posted by 9underpar 
Quote: Originally Posted by pparks1 The /MIR functionality instructs robocopy to mirror the source and the destination. So, if you have anything in F:\My DOcuments that doesn't match what is in the C:\location......you are going to have them removed from the destination. Is that what is happening here? PParks- thanks for your response. I copied all the docs from My Documents on my PC into the f:\My Documents folder. I then ran the batch file (as a test) which is what deleted everything on the external drive in f:\My Documents. Was the folder structure the same. If there was 1 extra subfolder on the destination, not on the source, it would have wiped it out. | My System Specs | | System Manufacturer/Model Number Self-Built in July 2009 OS Windows 7 Ultimate x64 CPU Intel Q9550 2.83Ghz OC'd to 3.40Ghz Motherboard Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS Memory 8GB G.Skill PI DDR2-800, 4-4-4-12 timings Graphics Card EVGA 1280MB Nvidia GeForce GTX570 Sound Card Realtek ALC899A 8 channel onboard audio Monitor(s) Displays 23" Acer x233H Screen Resolution 1920x1080 Keyboard ABS M1 Mechanical Mouse Logitech G9 Laser Mouse PSU Corsair 620HX modular Case Antec P182 Cooling stock Hard Drives Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS Internet Speed 15/2 cable modem Other Info Windows and Linux enthusiast. Logitech G35 Headset. |
12 Jun 2011
|
| | Windows 7 Home Premium 64 bit |
Thanks everyone for your help. It was my error- the source was on a network and I didn't specify the correct source folder. Robocopy now works and it is great! | My System Specs | | OS Windows 7 Home Premium 64 bit |
12 Jun 2011
|
| | Windows 7 Ultimate SP1 64-Bit Peterborough, England |
You're very welcome. Pleased to hear Robocopy did the trick for you and thanks for letting us know. | My System Specs | | System Manufacturer/Model Number HP Pavilion Elite 495UK OS Windows 7 Ultimate SP1 64-Bit CPU Intel Core i7 870 @ 2.93GHz Motherboard MSI 2A9C (CPU1) Memory 8Gb Dual-Channel DDR3 @ 664MHz Graphics Card nVidia GeForce GTX 460 1024MB dedicated RAM Sound Card Realtek HD Audio Monitor(s) Displays HP2310i Screen Resolution 1920 x 1080 Keyboard Logitech K750 solar-powered keyboard Mouse Logitech Wireless M180 mouse PSU 460W Case HP Elite Cooling Air cooled Hard Drives 1x1954GB Hitachi HDS22020ALA 330 (RAID), 1x1954GB Hitachi External for backup and storage Internet Speed 2Mb Other Info Pure Avanti Flow Internet Radio with iPod Dock, 64Gb iPod, HP USB Speakers, Sony MDR-V500 Headphones, Sony Vaio F-Series Laptop I know this is simple but...... problems? All times are GMT -5. The time now is 12:45 PM. | |